From 655aeebaa548778afb4581bb3a246723c2c89cef Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Sat, 11 Feb 2012 10:36:57 +0100 Subject: [PATCH] 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 --- debian/changelog | 3 +++ debian/systemd.postinst | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) 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 -- 2.39.5