diff options
author | Michael Stapelberg <stapelberg@debian.org> | 2012-07-29 19:46:53 +0200 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-10-15 14:07:50 -0400 |
commit | a0a7bb3433cba64677cf25c469d626552da9f356 (patch) | |
tree | 0ee3cc686ea9b34f8b84a9ea29426063adb26ec4 /autoscripts | |
parent | d5c2fb4cf3d9be4bb991a8dc918fd2c6a48fe374 (diff) | |
download | debhelper-a0a7bb3433cba64677cf25c469d626552da9f356.tar.gz |
Support systemd in dh_installinit and postinst/postrm
Diffstat (limited to 'autoscripts')
-rw-r--r-- | autoscripts/postinst-init | 6 | ||||
-rw-r--r-- | autoscripts/postinst-init-nostart | 6 | ||||
-rw-r--r-- | autoscripts/postinst-init-restart | 6 | ||||
-rw-r--r-- | autoscripts/postrm-init | 7 |
4 files changed, 25 insertions, 0 deletions
diff --git a/autoscripts/postinst-init b/autoscripts/postinst-init index 2430b2c0..f5371ce8 100644 --- a/autoscripts/postinst-init +++ b/autoscripts/postinst-init @@ -1,4 +1,10 @@ if [ -x "/etc/init.d/#SCRIPT#" ]; then + # In case this system is running systemd, we need to ensure that all + # necessary tmpfiles (if any) are created before starting. + if [ -d /sys/fs/cgroup/systemd ] ; then + systemd-tmpfiles --create >/dev/null || true + fi + update-rc.d #SCRIPT# #INITPARMS# >/dev/null invoke-rc.d #SCRIPT# start || #ERROR_HANDLER# fi diff --git a/autoscripts/postinst-init-nostart b/autoscripts/postinst-init-nostart index 7a1bd5e8..ec6bdbd6 100644 --- a/autoscripts/postinst-init-nostart +++ b/autoscripts/postinst-init-nostart @@ -1,3 +1,9 @@ if [ -x "/etc/init.d/#SCRIPT#" ]; then + # In case this system is running systemd, we need to ensure that all + # necessary tmpfiles (if any) are created before starting. + if [ -d /sys/fs/cgroup/systemd ] ; then + systemd-tmpfiles --create >/dev/null || true + fi + update-rc.d #SCRIPT# #INITPARMS# >/dev/null || #ERROR_HANDLER# fi diff --git a/autoscripts/postinst-init-restart b/autoscripts/postinst-init-restart index 35bba207..862f9cc3 100644 --- a/autoscripts/postinst-init-restart +++ b/autoscripts/postinst-init-restart @@ -1,4 +1,10 @@ if [ -x "/etc/init.d/#SCRIPT#" ]; then + # In case this system is running systemd, we need to ensure that all + # necessary tmpfiles (if any) are created before starting. + if [ -d /sys/fs/cgroup/systemd ] ; then + systemd-tmpfiles --create >/dev/null || true + fi + update-rc.d #SCRIPT# #INITPARMS# >/dev/null if [ -n "$2" ]; then _dh_action=restart diff --git a/autoscripts/postrm-init b/autoscripts/postrm-init index 1c292982..61dcfc53 100644 --- a/autoscripts/postrm-init +++ b/autoscripts/postrm-init @@ -1,3 +1,10 @@ if [ "$1" = "purge" ] ; then update-rc.d #SCRIPT# remove >/dev/null fi + + +# In case this system is running systemd, we make systemd reload the unit files +# to pick up changes. +if [ -d /sys/fs/cgroup/systemd ] ; then + systemctl --system daemon-reload >/dev/null || true +fi |