summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pitt <martin.pitt@ubuntu.com>2016-06-14 07:44:59 (GMT)
committerMartin Pitt <martin.pitt@ubuntu.com>2016-06-14 07:45:21 (GMT)
commitfd907eeaee672f3791b05f84b5bd8164c86604bd (patch)
treefda219706b44a2250fd83735badcc2ec51f4589f
parentb145d003bb7dd7dc714344f1ed0b6ca5f5f6e1c5 (diff)
debian/extra/init-functions.d/40-systemd: Do not call systemctl daemon-reload if the script is called as user
reportbug currently does that to determine $is_upstart. Also make sure that daemon-reload will not invoke polkit.
-rw-r--r--debian/changelog3
-rw-r--r--debian/extra/init-functions.d/40-systemd2
2 files changed, 4 insertions, 1 deletions
diff --git a/debian/changelog b/debian/changelog
index a238cbb..b84bb0a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -25,6 +25,9 @@ systemd (230-3) UNRELEASED; urgency=medium
(LP: #1579278)
* debian/systemd-container.install: Drop *.busname installation, they are
going away upstream.
+ * debian/extra/init-functions.d/40-systemd: Do not call systemctl
+ daemon-reload if the script is called as user (like reportbug does). Also
+ make sure that daemon-reload will not invoke polkit.
[ Michael Biebl ]
* Add "systemctl daemon-reload" to lsb init-functions hook if the LoadState
diff --git a/debian/extra/init-functions.d/40-systemd b/debian/extra/init-functions.d/40-systemd
index e3b9576..8e31544 100644
--- a/debian/extra/init-functions.d/40-systemd
+++ b/debian/extra/init-functions.d/40-systemd
@@ -14,7 +14,7 @@ if [ -d /run/systemd/system ]; then
# If the state is not-found, this might be a newly installed SysV init
# script where systemd-sysv-generator has not been run yet.
- [ "$state" != "not-found" ] || systemctl daemon-reload
+ [ "$state" != "not-found" ] || [ "$(id -u)" != 0 ] || systemctl --no-ask-password daemon-reload
# Redirect SysV init scripts when executed by the user
if [ $PPID -ne 1 ] && [ -z "${init:-}" ] && [ -z "${_SYSTEMCTL_SKIP_REDIRECT:-}" ]; then