mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
regenconf: sometimes ntp doesnt exist
This commit is contained in:
parent
20e8805e3b
commit
97c0128c22
1 changed files with 12 additions and 6 deletions
|
@ -125,12 +125,15 @@ EOF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Skip ntp if inside a container (inspired from the conf of systemd-timesyncd)
|
# Skip ntp if inside a container (inspired from the conf of systemd-timesyncd)
|
||||||
mkdir -p ${pending_dir}/etc/systemd/system/ntp.service.d/
|
if systemctl | grep -q 'ntp.service'
|
||||||
cat >${pending_dir}/etc/systemd/system/ntp.service.d/ynh-override.conf <<EOF
|
then
|
||||||
|
mkdir -p ${pending_dir}/etc/systemd/system/ntp.service.d/
|
||||||
|
cat >${pending_dir}/etc/systemd/system/ntp.service.d/ynh-override.conf <<EOF
|
||||||
[Unit]
|
[Unit]
|
||||||
ConditionCapability=CAP_SYS_TIME
|
ConditionCapability=CAP_SYS_TIME
|
||||||
ConditionVirtualization=!container
|
ConditionVirtualization=!container
|
||||||
EOF
|
EOF
|
||||||
|
fi
|
||||||
|
|
||||||
# Make nftable conflict with yunohost-firewall
|
# Make nftable conflict with yunohost-firewall
|
||||||
mkdir -p ${pending_dir}/etc/systemd/system/nftables.service.d/
|
mkdir -p ${pending_dir}/etc/systemd/system/nftables.service.d/
|
||||||
|
@ -215,10 +218,13 @@ do_post_regen() {
|
||||||
grep -q '^sftp.app:' /etc/group || groupadd sftp.app
|
grep -q '^sftp.app:' /etc/group || groupadd sftp.app
|
||||||
|
|
||||||
# Propagates changes in systemd service config overrides
|
# Propagates changes in systemd service config overrides
|
||||||
[[ ! "$regen_conf_files" =~ "ntp.service.d/ynh-override.conf" ]] || {
|
if systemctl | grep -q 'ntp.service'
|
||||||
systemctl daemon-reload
|
then
|
||||||
systemctl restart ntp
|
[[ ! "$regen_conf_files" =~ "ntp.service.d/ynh-override.conf" ]] || {
|
||||||
}
|
systemctl daemon-reload
|
||||||
|
systemctl restart ntp
|
||||||
|
}
|
||||||
|
fi
|
||||||
[[ ! "$regen_conf_files" =~ "nftables.service.d/ynh-override.conf" ]] || systemctl daemon-reload
|
[[ ! "$regen_conf_files" =~ "nftables.service.d/ynh-override.conf" ]] || systemctl daemon-reload
|
||||||
[[ ! "$regen_conf_files" =~ "login.conf.d/ynh-override.conf" ]] || {
|
[[ ! "$regen_conf_files" =~ "login.conf.d/ynh-override.conf" ]] || {
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
|
|
Loading…
Add table
Reference in a new issue