]> git.proxmox.com Git - systemd.git/commitdiff
Fix logind startup condition to not hardcode dbus-daemon path
authorMartin Pitt <martin.pitt@ubuntu.com>
Mon, 9 Feb 2015 14:22:33 +0000 (15:22 +0100)
committerMartin Pitt <martin.pitt@ubuntu.com>
Mon, 9 Feb 2015 14:22:33 +0000 (15:22 +0100)
In Ubuntu dbus-daemon is in /bin, so use pkg-config to determine the path of
the daemon instead of hardcoding it. Use sed instead of a static patch.

debian/patches/Only-start-logind-if-dbus-is-installed.patch [deleted file]
debian/patches/series
debian/rules

diff --git a/debian/patches/Only-start-logind-if-dbus-is-installed.patch b/debian/patches/Only-start-logind-if-dbus-is-installed.patch
deleted file mode 100644 (file)
index 1823dba..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-From: Martin Pitt <martin.pitt@ubuntu.com>
-Date: Mon, 9 Feb 2015 10:53:43 +0100
-Subject: Only start logind if dbus is installed
-
-logind fails to start in environments without dbus, such as LXC containers or
-servers. Add a startup condition to avoid the very noisy startup failure.
-
-Part of #772700
----
- units/systemd-logind.service.in | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/units/systemd-logind.service.in b/units/systemd-logind.service.in
-index f087e99..860cb25 100644
---- a/units/systemd-logind.service.in
-+++ b/units/systemd-logind.service.in
-@@ -12,6 +12,7 @@ Documentation=http://www.freedesktop.org/wiki/Software/systemd/logind
- Documentation=http://www.freedesktop.org/wiki/Software/systemd/multiseat
- Wants=user.slice
- After=nss-user-lookup.target user.slice
-+ConditionFileIsExecutable=/usr/bin/dbus-daemon
- # Ask for the dbus socket. If running over kdbus, the socket will
- # not be actually used.
index eafc4be3ee5297fd6919cea99c439ee109451755..8af03d8961b72451afce8bf40aaf30e5a4fcf83d 100644 (file)
@@ -65,4 +65,3 @@ Accept-mountall-specific-fstab-options.patch
 Fix-usr-remount-failure-for-split-usr.patch
 util-Add-hidden-suffixes-for-ucf.patch
 Drop-rc-local-generator.patch
-Only-start-logind-if-dbus-is-installed.patch
index 6a48244dc003f99253cf271b167e30f721e6d0f3..3814375d8da5e83c42e663e5777f84f58db4b11c 100755 (executable)
@@ -10,6 +10,8 @@ ifneq (,$(findstring stage1,$(DEB_BUILD_PROFILES)))
 BOOTSTRAP_DH_FLAGS := -Ngir1.2-gudev-1.0 -Nlibgudev-1.0-0 -Nlibgudev-1.0-dev
 endif
 
+DBUS_DAEMONDIR = $(shell pkg-config --variable=daemondir dbus-1)
+
 CONFFLAGS = \
        --with-rootprefix= \
        --with-rootlibdir=/lib/$(DEB_HOST_MULTIARCH) \
@@ -181,7 +183,12 @@ endif
        rm debian/udev/lib/udev/rules.d/99-systemd.rules
 
        # Debian specific units
-       sed "s!@DBUS_DAEMONDIR@!$$(pkg-config --variable=daemondir dbus-1)!" < debian/extra/getty-static.service.in > debian/systemd/lib/systemd/system/getty-static.service
+       sed 's!@DBUS_DAEMONDIR@!$(DBUS_DAEMONDIR)!' < debian/extra/getty-static.service.in > debian/systemd/lib/systemd/system/getty-static.service
+
+       # logind fails to start in environments without D-BUS, such as LXC
+       # containers or servers. Add a startup condition to avoid the very
+       # noisy startup failure.
+       sed -i '/\[Service\]/ s!^!ConditionFileIsExecutable=$(DBUS_DAEMONDIR)/dbus-daemon\n\n!' debian/systemd/lib/systemd/system/systemd-logind.service
 
        # Ubuntu specific files
        if dpkg-vendor --is ubuntu; then \