Skip to content

Commit c47d4b2

Browse files
committed
Enable sd_bus_set_exit_on_disconnect
It does not make sense to keep running when we lose connection to one of our dbus connections. systemd/systemd#15879
1 parent c33f150 commit c47d4b2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

main.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ int main(int argc, char* argv[])
8484
const char* a = NULL;
8585
sd_bus_get_address(user_bus, &a);
8686
debug("ok: %s\n", a);
87+
sd_bus_set_exit_on_disconnect(user_bus, 1);
8788
}
8889

8990
debug("connecting to d-bus system bus: ");
@@ -96,6 +97,7 @@ int main(int argc, char* argv[])
9697
const char* a = NULL;
9798
sd_bus_get_address(system_bus, &a);
9899
debug("ok: %s\n", a);
100+
sd_bus_set_exit_on_disconnect(system_bus, 1);
99101
}
100102

101103
// Connect D-Bus signal handler

0 commit comments

Comments
 (0)