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
c55d506d9c
commit
c3ffd5c419
|
@ -1,10 +1,9 @@
|
||||||
[Unit]
|
[Unit]
|
||||||
Description="Reload Apache on changes to sites-enabled configs"
|
Description="Reload Apache on changes to sites-enabled configs"
|
||||||
After=apache2.service
|
|
||||||
|
|
||||||
[Path]
|
[Path]
|
||||||
PathChanged=/etc/apache2/sites-enabled/
|
PathChanged=/etc/apache2/sites-enabled/
|
||||||
Unit=vhost-reload-apache.service
|
Unit=vhost-reload-apache.service
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=paths.target
|
||||||
|
|
|
@ -4,4 +4,4 @@ Description=Reload Apache
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
ExecStartPre=sleep 2
|
ExecStartPre=sleep 2
|
||||||
ExecStart=systemctl reload apache2
|
ExecStart=systemctl try-reload-or-restart apache2
|
||||||
|
|
|
@ -6,4 +6,4 @@ PathChanged=/etc/jailkit/jk_socketd.ini
|
||||||
Unit=vhost-reload-jailkit.service
|
Unit=vhost-reload-jailkit.service
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=paths.target
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
[Unit]
|
[Unit]
|
||||||
Description="Reload PHP-FPM on changes to pool config files"
|
Description="Reload PHP-FPM on changes to pool config files"
|
||||||
After=php8.1-fpm.service
|
|
||||||
|
|
||||||
[Path]
|
[Path]
|
||||||
PathChanged=/etc/php/8.1/fpm/pool.d/
|
PathChanged=/etc/php/8.1/fpm/pool.d/
|
||||||
|
|
|
@ -4,4 +4,4 @@ Description=Reload PHP-FPM
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
ExecStartPre=sleep 2
|
ExecStartPre=sleep 2
|
||||||
ExecStart=systemctl reload php8.1-fpm
|
ExecStart=systemctl try-reload-or-restart php8.1-fpm
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
[Unit]
|
[Unit]
|
||||||
Description="Reload Varnish on changes to site configs"
|
Description="Reload Varnish on changes to site configs"
|
||||||
After=varnish.service
|
|
||||||
|
|
||||||
[Path]
|
[Path]
|
||||||
PathChanged=/etc/varnish/sites.d/
|
PathChanged=/etc/varnish/sites.d/
|
||||||
|
@ -8,4 +7,4 @@ PathChanged=/etc/varnish/sites.vcl
|
||||||
Unit=vhost-reload-varnish.service
|
Unit=vhost-reload-varnish.service
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=paths.target
|
||||||
|
|
|
@ -4,4 +4,4 @@ Description=Reload Varnish
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
ExecStartPre=sleep 1
|
ExecStartPre=sleep 1
|
||||||
ExecStart=systemctl reload varnish.service
|
ExecStart=systemctl try-reload-or-restart varnish.service
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
#
|
#
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Webalizer - generate stats from apache logs
|
Description=Webalizer - generate stats from apache logs
|
||||||
After=logrotate.service
|
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
|
|
|
@ -90,7 +90,7 @@ do
|
||||||
cp systemd/$systemdConfig /usr/local/lib/systemd/system/$systemdConfig
|
cp systemd/$systemdConfig /usr/local/lib/systemd/system/$systemdConfig
|
||||||
chmod 644 /usr/local/lib/systemd/system/$systemdConfig
|
chmod 644 /usr/local/lib/systemd/system/$systemdConfig
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
systemctl --quiet is-active $systemdConfig && systemctl --quiet reload $systemdConfig
|
systemctl --quiet try-reload-or-restart $systemdConfig
|
||||||
echo "systemd/$systemdConfig updated"
|
echo "systemd/$systemdConfig updated"
|
||||||
echo
|
echo
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue
Block a user