Package: sysv-rc
Version: 2.88dsf-22.1
Severity: wishlist
Tags: patch

Please apply the attached patch to jessie-pending. It fixes the systemd
checks to work properly on systems that use standalone logind without
systemd.

Quote from the commit message:

[PATCH] systemd: update check to look for /run/systemd/system

The old check (for /sys/fs/cgroup/systemd) is a false-positive on
systems which use standalone logind, but not systemd.

The new one is recommended and used by upstream systemd in their
sd_booted() implementation, see
http://cgit.freedesktop.org/systemd/systemd/tree/src/libsystemd-daemon/sd-daemon.c#n518

-- 
Best regards,
Michael
>From 37dcf68cc98f47d4661db86e8263ccb8a56b8ec9 Mon Sep 17 00:00:00 2001
From: Michael Stapelberg <stapelb...@debian.org>
Date: Thu, 21 Mar 2013 00:47:56 +0100
Subject: [PATCH] systemd: update check to look for /run/systemd/system

The old check (for /sys/fs/cgroup/systemd) is a false-positive on
systems which use standalone logind, but not systemd.

The new one is recommended and used by upstream systemd in their
sd_booted() implementation, see
http://cgit.freedesktop.org/systemd/systemd/tree/src/libsystemd-daemon/sd-daemon.c#n518
---
 debian/postinst                     |    2 +-
 debian/src/sysv-rc/sbin/invoke-rc.d |    2 +-
 debian/src/sysv-rc/sbin/update-rc.d |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/debian/postinst b/debian/postinst
index 515eb99..1750412 100755
--- a/debian/postinst
+++ b/debian/postinst
@@ -96,7 +96,7 @@ fi
 
 # If systemd is running, don't restart init or doing any initctl
 # migration.
-if [ -e /sys/fs/cgroup/systemd ]; then
+if [ -d /run/systemd/system ]; then
 	restart=no
 fi
 if [ "$(uname -s)" = "GNU" ]; then
diff --git a/debian/src/sysv-rc/sbin/invoke-rc.d b/debian/src/sysv-rc/sbin/invoke-rc.d
index 3d99591..b589721 100644
--- a/debian/src/sysv-rc/sbin/invoke-rc.d
+++ b/debian/src/sysv-rc/sbin/invoke-rc.d
@@ -274,7 +274,7 @@ if which initctl >/dev/null && initctl version | grep -q upstart \
    && [ -e "$UPSTARTDIR/${INITSCRIPTID}.conf" ]
 then
     is_upstart=1
-elif test -e /sys/fs/cgroup/systemd ; then
+elif test -d /run/systemd/system ; then
     is_systemd=1
 elif test ! -f "${INITDPREFIX}${INITSCRIPTID}" ; then
     ## Verifies if the given initscript ID is known
diff --git a/debian/src/sysv-rc/sbin/update-rc.d b/debian/src/sysv-rc/sbin/update-rc.d
index fb5b009..f3ef2bf 100755
--- a/debian/src/sysv-rc/sbin/update-rc.d
+++ b/debian/src/sysv-rc/sbin/update-rc.d
@@ -393,7 +393,7 @@ sub make_systemd_links {
         # If we changed anything and this machine is running systemd, tell
         # systemd to reload so that it will immediately pick up our
         # changes.
-        if ($changed_sth && -e "/sys/fs/cgroup/systemd") {
+        if ($changed_sth && -d "/run/systemd/system") {
             system("systemctl", "daemon-reload");
         }
     }
-- 
1.7.10.4

Reply via email to