From a821caaae15a39cd38be6dd3d1c3ca37c4ac0364 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 9 Jul 2010 23:18:50 +0200 Subject: [PATCH] main: make it possible to run a system daemon along side an aloready running one for testing purposes --- src/dbus.c | 2 +- src/manager.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dbus.c b/src/dbus.c index 2998c581..1620469e 100644 --- a/src/dbus.c +++ b/src/dbus.c @@ -907,7 +907,7 @@ static int bus_init_private(Manager *m) { 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))) { diff --git a/src/manager.c b/src/manager.c index adff5463..638ef2f4 100644 --- a/src/manager.c +++ b/src/manager.c @@ -83,7 +83,7 @@ static int manager_setup_notify(Manager *m) { 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); -- 2.39.5