]> err.no Git - systemd/commitdiff
Avoid error messages from systemctl in postinst
authorMichael Biebl <biebl@debian.org>
Sat, 11 Feb 2012 09:36:57 +0000 (10:36 +0100)
committerTollef Fog Heen <tfheen@err.no>
Mon, 27 Feb 2012 21:48:23 +0000 (22:48 +0100)
if systemd is not running by checking for /sys/fs/cgroup/systemd before
executing systemctl. Closes: #642749

Conflicts:

debian/changelog

debian/changelog
debian/systemd.postinst

index 0ea028844e6f3f740c0e3e05be1e616ddb806233..2e077aca319a8dcd3f0abe22aa94c5a46365c563 100644 (file)
@@ -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 <tfheen@debian.org>  Tue, 07 Feb 2012 21:36:34 +0100
 
index 7f7c2daacacd4b2ae908a79d8c91631ba2bca2a5..56f508a79e494bad61849ccf140c6f22f5d2378f 100644 (file)
@@ -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