From: Michael Biebl Date: Sat, 11 Feb 2012 09:36:57 +0000 (+0100) Subject: Avoid error messages from systemctl in postinst X-Git-Tag: 43-1~29 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=655aeebaa548778afb4581bb3a246723c2c89cef;p=systemd Avoid error messages from systemctl in postinst if systemd is not running by checking for /sys/fs/cgroup/systemd before executing systemctl. Closes: #642749 Conflicts: debian/changelog --- diff --git a/debian/changelog b/debian/changelog index 0ea02884..2e077aca 100644 --- a/debian/changelog +++ b/debian/changelog @@ -25,6 +25,9 @@ systemd (43-1) unstable; urgency=low * Install /var/log/journal directory where the journal files are stored persistently. * Setup systemd-journald to not read from /proc/kmsg (ImportKernel=no). + * Avoid error messages from systemctl in postinst if systemd is not running + by checking for /sys/fs/cgroup/systemd before executing systemctl. + Closes: #642749 -- Tollef Fog Heen Tue, 07 Feb 2012 21:36:34 +0100 diff --git a/debian/systemd.postinst b/debian/systemd.postinst index 7f7c2daa..56f508a7 100644 --- a/debian/systemd.postinst +++ b/debian/systemd.postinst @@ -2,8 +2,14 @@ set -e +_systemctl() { + if [ -e /sys/fs/cgroup/systemd ]; then + systemctl "$@" + fi +} + if [ -n "$2" ]; then - systemctl daemon-reexec || true + _systemctl daemon-reexec || true fi # Do a one-time migration of the local time setting