summaryrefslogtreecommitdiffstats
path: root/patches/systemd-20/0005-dbus-fix-system-handling.patch
blob: ff097b520ad73fcb8b56e6bad000917e87eb696e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
From 88a053f041a07c75d5395261524b5cf695284430 Mon Sep 17 00:00:00 2001
From: Robert Schwebel <r.schwebel@pengutronix.de>
Date: Thu, 14 Oct 2010 17:53:07 +0200
Subject: [PATCH] dbus: fix --system handling

We currently only create the private D-Bus server when pid == 1, but
this has also to be done if the user started us with --system.
Otherwhise we get this error:

  systemd-cgroups-agent[164]: Failed to get D-Bus connection:
  Failed to connect to socket /org/freedesktop/systemd1/private: Connection refused

Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
---
 src/dbus.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: systemd-18/src/dbus.c
===================================================================
--- systemd-18.orig/src/dbus.c
+++ systemd-18/src/dbus.c
@@ -952,7 +952,7 @@ static int bus_init_private(Manager *m)
                 return 0;
 
         /* We want the private bus only when running as init */
-        if (getpid() != 1)
+        if (m->running_as != MANAGER_SYSTEM)
                 return 0;
 
         if (!(m->private_bus = dbus_server_listen("unix:abstract=/org/freedesktop/systemd1/private", &error))) {