rework systemd stuff
move service to paths.target remove startup dependency change to try-reload-or-restart which has this logic: Reload service if it supports it. If not, stop and then start instead. Does nothing if the service is not running.
This commit is contained in:
parent
80db965dbf
commit
92af4b365b
|
@ -10,9 +10,6 @@ services=(apache2 dovecot exim4 haproxy postfix)
|
|||
|
||||
# Cycle through each service.
|
||||
for service in "${services[@]}"; do
|
||||
# Check if service is active.
|
||||
if systemctl --quiet is-active $service; then
|
||||
# Reload service.
|
||||
systemctl reload $service
|
||||
fi
|
||||
# Reload service if it supports it. If not, stop and then start instead. This does nothing if the service is not running.
|
||||
systemctl try-reload-or-restart $service
|
||||
done
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
[Unit]
|
||||
Description="Monitor /var/tmp/letsencrypt/ for cert names to deploy."
|
||||
After=apache2.service
|
||||
|
||||
[Path]
|
||||
# TriggerLimitIntervalSec=60 - not available until next version of systemd (250)
|
||||
|
@ -10,4 +9,4 @@ DirectoryNotEmpty=/var/tmp/letsencrypt
|
|||
Unit=letsencrypt-deploy.service
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
WantedBy=paths.target
|
||||
|
|
Loading…
Reference in New Issue
Block a user