From c47d4b2f1dcdaac1cbc1c0bcc8f79b3fab1b65ce Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Thu, 21 May 2020 23:25:58 +0200 Subject: [PATCH] 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. https://github.com/systemd/systemd/issues/15879 --- main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main.c b/main.c index ab33084..69111f5 100644 --- a/main.c +++ b/main.c @@ -84,6 +84,7 @@ int main(int argc, char* argv[]) const char* a = NULL; sd_bus_get_address(user_bus, &a); debug("ok: %s\n", a); + sd_bus_set_exit_on_disconnect(user_bus, 1); } debug("connecting to d-bus system bus: "); @@ -96,6 +97,7 @@ int main(int argc, char* argv[]) const char* a = NULL; sd_bus_get_address(system_bus, &a); debug("ok: %s\n", a); + sd_bus_set_exit_on_disconnect(system_bus, 1); } // Connect D-Bus signal handler