aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Guthrie <colin@mageia.org>2012-03-19 19:09:35 +0000
committerColin Guthrie <colin@mageia.org>2012-03-19 19:09:35 +0000
commitd3c3d61dd783efe6f22fc62f88c0229da6a0ef9a (patch)
tree31771e0e05deba4991fe2cf795ccba7a4540445f
parent699d60f6264de5cd0d6c88833bf3fbab728c23d9 (diff)
downloadrpm-helper-d3c3d61dd783efe6f22fc62f88c0229da6a0ef9a.tar
rpm-helper-d3c3d61dd783efe6f22fc62f88c0229da6a0ef9a.tar.gz
rpm-helper-d3c3d61dd783efe6f22fc62f88c0229da6a0ef9a.tar.bz2
rpm-helper-d3c3d61dd783efe6f22fc62f88c0229da6a0ef9a.tar.xz
rpm-helper-d3c3d61dd783efe6f22fc62f88c0229da6a0ef9a.zip
Always reload systemd unit cache before attempting to restart units
-rw-r--r--NEWS2
-rwxr-xr-xadd-service6
2 files changed, 5 insertions, 3 deletions
diff --git a/NEWS b/NEWS
index 5bf112e..9119d8d 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,5 @@
+ * always reload systemd unit cache before working with them
+
2012-03-12 Guillaume Rousse <guillomovitch@gmail.com> 0.24.7
* drop dead code from add-syslog
* fix add-syslog documentation
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);