diff --git a/systemd/vhost-reload-apache.path b/systemd/vhost-reload-apache.path index 8e5f9ff..0470fbd 100644 --- a/systemd/vhost-reload-apache.path +++ b/systemd/vhost-reload-apache.path @@ -1,10 +1,9 @@ [Unit] Description="Reload Apache on changes to sites-enabled configs" -After=apache2.service [Path] PathChanged=/etc/apache2/sites-enabled/ Unit=vhost-reload-apache.service [Install] -WantedBy=multi-user.target +WantedBy=paths.target diff --git a/systemd/vhost-reload-apache.service b/systemd/vhost-reload-apache.service index 0332290..7fdaa27 100644 --- a/systemd/vhost-reload-apache.service +++ b/systemd/vhost-reload-apache.service @@ -4,4 +4,4 @@ Description=Reload Apache [Service] Type=oneshot ExecStartPre=sleep 2 -ExecStart=systemctl reload apache2 +ExecStart=systemctl try-reload-or-restart apache2 diff --git a/systemd/vhost-reload-jailkit.path b/systemd/vhost-reload-jailkit.path index d119716..a89c83c 100644 --- a/systemd/vhost-reload-jailkit.path +++ b/systemd/vhost-reload-jailkit.path @@ -6,4 +6,4 @@ PathChanged=/etc/jailkit/jk_socketd.ini Unit=vhost-reload-jailkit.service [Install] -WantedBy=multi-user.target +WantedBy=paths.target diff --git a/systemd/vhost-reload-php.path b/systemd/vhost-reload-php.path index 8741866..476f1e9 100644 --- a/systemd/vhost-reload-php.path +++ b/systemd/vhost-reload-php.path @@ -1,6 +1,5 @@ [Unit] Description="Reload PHP-FPM on changes to pool config files" -After=php8.1-fpm.service [Path] PathChanged=/etc/php/8.1/fpm/pool.d/ diff --git a/systemd/vhost-reload-php.service b/systemd/vhost-reload-php.service index 8950a80..b84446c 100644 --- a/systemd/vhost-reload-php.service +++ b/systemd/vhost-reload-php.service @@ -4,4 +4,4 @@ Description=Reload PHP-FPM [Service] Type=oneshot ExecStartPre=sleep 2 -ExecStart=systemctl reload php8.1-fpm +ExecStart=systemctl try-reload-or-restart php8.1-fpm diff --git a/systemd/vhost-reload-varnish.path b/systemd/vhost-reload-varnish.path index 1b6b893..7c65531 100644 --- a/systemd/vhost-reload-varnish.path +++ b/systemd/vhost-reload-varnish.path @@ -1,6 +1,5 @@ [Unit] Description="Reload Varnish on changes to site configs" -After=varnish.service [Path] PathChanged=/etc/varnish/sites.d/ @@ -8,4 +7,4 @@ PathChanged=/etc/varnish/sites.vcl Unit=vhost-reload-varnish.service [Install] -WantedBy=multi-user.target +WantedBy=paths.target diff --git a/systemd/vhost-reload-varnish.service b/systemd/vhost-reload-varnish.service index 5b8d858..182ce2d 100644 --- a/systemd/vhost-reload-varnish.service +++ b/systemd/vhost-reload-varnish.service @@ -4,4 +4,4 @@ Description=Reload Varnish [Service] Type=oneshot ExecStartPre=sleep 1 -ExecStart=systemctl reload varnish.service +ExecStart=systemctl try-reload-or-restart varnish.service diff --git a/systemd/webalizer.service b/systemd/webalizer.service index e65ad7c..1faa6bb 100644 --- a/systemd/webalizer.service +++ b/systemd/webalizer.service @@ -5,7 +5,6 @@ # [Unit] Description=Webalizer - generate stats from apache logs -After=logrotate.service [Service] Type=simple diff --git a/update.sh b/update.sh index 231d986..372ee3e 100755 --- a/update.sh +++ b/update.sh @@ -90,7 +90,7 @@ do cp systemd/$systemdConfig /usr/local/lib/systemd/system/$systemdConfig chmod 644 /usr/local/lib/systemd/system/$systemdConfig systemctl daemon-reload - systemctl --quiet is-active $systemdConfig && systemctl --quiet reload $systemdConfig + systemctl --quiet try-reload-or-restart $systemdConfig echo "systemd/$systemdConfig updated" echo fi