chiark / gitweb /
main: make it possible to run a system daemon along side an aloready running one...
authorLennart Poettering <lennart@poettering.net>
Fri, 9 Jul 2010 21:18:50 +0000 (23:18 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 9 Jul 2010 21:43:16 +0000 (23:43 +0200)
src/dbus.c
src/manager.c

index 2998c5817833f88357da3b8c61ae3d8e435d5c9e..1620469e0efcf9aa5450577c158b1908bfc51124 100644 (file)
@@ -907,7 +907,7 @@ static int bus_init_private(Manager *m) {
                 return 0;
 
         /* We want the private bus only when running as init */
                 return 0;
 
         /* We want the private bus only when running as init */
-        if (m->running_as != MANAGER_SYSTEM)
+        if (getpid() != 1)
                 return 0;
 
         if (!(m->private_bus = dbus_server_listen("unix:abstract=/org/freedesktop/systemd1/private", &error))) {
                 return 0;
 
         if (!(m->private_bus = dbus_server_listen("unix:abstract=/org/freedesktop/systemd1/private", &error))) {
index adff54639731d2e3fd7fb0850a1e8324450c47e9..638ef2f4500af4997ea01f946ee2a039706c5a95 100644 (file)
@@ -83,7 +83,7 @@ static int manager_setup_notify(Manager *m) {
         zero(sa);
         sa.sa.sa_family = AF_UNIX;
 
         zero(sa);
         sa.sa.sa_family = AF_UNIX;
 
-        if (m->running_as == MANAGER_SESSION)
+        if (getpid() != 1)
                 snprintf(sa.un.sun_path+1, sizeof(sa.un.sun_path)-1, NOTIFY_SOCKET "/%llu", random_ull());
         else
                 strncpy(sa.un.sun_path+1, NOTIFY_SOCKET, sizeof(sa.un.sun_path)-1);
                 snprintf(sa.un.sun_path+1, sizeof(sa.un.sun_path)-1, NOTIFY_SOCKET "/%llu", random_ull());
         else
                 strncpy(sa.un.sun_path+1, NOTIFY_SOCKET, sizeof(sa.un.sun_path)-1);