-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #667 from openziti/bugfix/issue-548
reload services in debian post script
- Loading branch information
Showing
3 changed files
with
33 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,7 +44,6 @@ if [ "$1" = "configure" ]; then | |
override_dir="@SYSTEMD_UNIT_DIR@/@[email protected]" | ||
mkdir -p "${override_dir}/" | ||
( echo '[Service]'; echo "User=root" ) > "${override_dir}/10-run-as-root.conf" | ||
# todo ok to `systemctl daemon-reload` here? | ||
fi | ||
fi | ||
|
||
|
@@ -54,19 +53,31 @@ fi | |
|
||
# Copied from https://github.com/Debian/debhelper/blob/master/autoscripts/postinst-systemd-dont-enable | ||
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then | ||
if deb-systemd-helper debian-installed @SYSTEMD_UNIT_FILE_NAME@; then | ||
# This will only remove masks created by d-s-h on package removal. | ||
deb-systemd-helper unmask @SYSTEMD_UNIT_FILE_NAME@ >/dev/null || true | ||
if deb-systemd-helper debian-installed @SYSTEMD_UNIT_FILE_NAME@; then | ||
# This will only remove masks created by d-s-h on package removal. | ||
deb-systemd-helper unmask @SYSTEMD_UNIT_FILE_NAME@ >/dev/null || true | ||
|
||
if deb-systemd-helper --quiet was-enabled @SYSTEMD_UNIT_FILE_NAME@; then | ||
# Create new symlinks, if any. | ||
deb-systemd-helper enable @SYSTEMD_UNIT_FILE_NAME@ >/dev/null || true | ||
fi | ||
fi | ||
if deb-systemd-helper --quiet was-enabled @SYSTEMD_UNIT_FILE_NAME@; then | ||
# Create new symlinks, if any. | ||
deb-systemd-helper enable @SYSTEMD_UNIT_FILE_NAME@ >/dev/null || true | ||
fi | ||
fi | ||
|
||
# Update the statefile to add new symlinks (if any), which need to be cleaned | ||
# up on purge. Also remove old symlinks. | ||
deb-systemd-helper update-state @SYSTEMD_UNIT_FILE_NAME@ >/dev/null || true | ||
fi | ||
# End copied section | ||
|
||
# Update the statefile to add new symlinks (if any), which need to be cleaned | ||
# up on purge. Also remove old symlinks. | ||
deb-systemd-helper update-state @SYSTEMD_UNIT_FILE_NAME@ >/dev/null || true | ||
# Copied from https://github.com/Debian/debhelper/blob/master/autoscripts/postinst-systemd-restartnostart | ||
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then | ||
if [ -d /run/systemd/system ]; then | ||
systemctl --system daemon-reload >/dev/null || true | ||
# TODO: Handle service restart | ||
# if [ -n "$2" ]; then | ||
# deb-systemd-invoke try-restart @SYSTEMD_UNIT_FILE_NAME@ >/dev/null || true | ||
# fi | ||
fi | ||
fi | ||
# End copied section | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# Coped from https://github.com/Debian/debhelper/blob/master/autoscripts/prerm-systemd | ||
if [ -d /run/systemd/system ] && [ "$1" = "remove" ]; then | ||
deb-systemd-invoke stop @SYSTEMD_UNIT_FILE_NAME@ >/dev/null || true | ||
deb-systemd-invoke stop @SYSTEMD_UNIT_FILE_NAME@ >/dev/null || true | ||
fi | ||
# End copied section |