From d3c3d61dd783efe6f22fc62f88c0229da6a0ef9a Mon Sep 17 00:00:00 2001 From: Colin Guthrie Date: Mon, 19 Mar 2012 19:09:35 +0000 Subject: Always reload systemd unit cache before attempting to restart units --- add-service | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'add-service') diff --git a/add-service b/add-service index bd51d86..bd16c8f 100755 --- a/add-service +++ b/add-service @@ -234,9 +234,6 @@ else fi done done - if [ x$init = xsystemd ]; then - /bin/systemctl --system daemon-reload - fi fi # It could be that a package is installed but not enabled. @@ -248,6 +245,9 @@ else fi if [ x$init = xsystemd ]; then + # Package install may have changed the unit file, so reload the daemon + # before trying to restart anything + /bin/systemctl --system daemon-reload /bin/systemctl --quiet try-restart $units elif [ -f /etc/rc.d/init.d/$srv ]; then script=$(check_sysvinit_service 3 $srv); -- cgit v1.2.1