mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-02-04 17:47:03 +03:00
main: make it possible to run a system daemon along side an aloready running one for testing purposes
This commit is contained in:
parent
71a6f75381
commit
a821caaae1
@ -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))) {
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user