Commit 10952c54 authored by Michael Biebl's avatar Michael Biebl

Update the checks which test if systemd is the active init.

The recommended check is [ -d /run/systemd/system ] as this will also
work with a standalone systemd-logind.
parent 445f8dfd
......@@ -7,6 +7,9 @@ systemd (44-12) UNRELEASED; urgency=low
debian-enable-units script a no-op. The auto-enabler was meant as a
temporary workaround and will be removed once all packages use the new
helper.
* Update the checks which test if systemd is the active init. The
recommended check is [ -d /run/systemd/system ] as this will also work
with a standalone systemd-logind.
-- Michael Biebl <biebl@debian.org> Thu, 20 Jun 2013 00:54:30 +0200
......
......@@ -12,7 +12,7 @@ if [ -x /usr/bin/deb-systemd-helper ] ; then
fi
# If systemd is not running, schedule a run on next boot
if ! [ -e /sys/fs/cgroup/systemd ] ; then
if ! [ -d /run/systemd/system ] ; then
touch $statedir/run-debian-enable-units
exit 0
else
......
# -*-Shell-script-*-
# /lib/lsb/init-functions
if [ -e /sys/fs/cgroup/systemd ]; then
if [ -d /run/systemd/system ]; then
# Some init scripts use "set -e" and "set -u", we don't want that
# here
set +e
......
......@@ -7,7 +7,7 @@ set -e
# sysvinit version which created the initctl socket at /run/initctl.
# systemd's sysv tools expect the socket at /dev/initctl, so create the compat
# symlink ourselves.
if [ ! -e /sys/fs/cgroup/systemd ] ; then
if [ ! -d /run/systemd/system ] ; then
if [ ! -p /dev/initctl ] && [ -p /run/initctl ] ; then
ln -sf /run/initctl /dev/initctl
fi
......
......@@ -3,7 +3,7 @@
set -e
_systemctl() {
if [ -e /sys/fs/cgroup/systemd ]; then
if [ -d /run/systemd/system ]; then
systemctl "$@"
fi
}
......@@ -51,7 +51,7 @@ EOF
fi
# Create /run/initctl → /dev/initctl compat symlink on upgrades
if [ -e /sys/fs/cgroup/systemd ]; then
if [ -d /run/systemd/system ]; then
_systemctl restart systemd-initctl.socket || true
fi
......@@ -64,7 +64,7 @@ if dpkg --compare-versions "$2" lt "40-1"; then
fi
# Create /run/initctl → /dev/initctl compat symlink on upgrades
if [ -e /sys/fs/cgroup/systemd ]; then
if [ -d /run/systemd/system ]; then
ln -sf /dev/initctl /run/initctl
fi
fi
......
......@@ -7,7 +7,7 @@ set -e
# will not work.
#
if [ "$1" = "remove" ] && [ -e /sys/fs/cgroup/systemd ]; then
if [ "$1" = "remove" ] && [ -d /run/systemd/system ]; then
echo "systemd is the active init system, please switch to another before removing systemd."
exit 1
fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment