Skip to content

Commit 19abef6

Browse files
rpigottbluca
authored andcommitted
dbus: log disconnect on api and system busses
This is an interesting event. Let's log about it. (cherry picked from commit 11ee1ba) (cherry picked from commit c189ecc) (cherry picked from commit 7054f66) (cherry picked from commit d0684df) (cherry picked from commit a88e98a) (cherry picked from commit 7bdec4c)
1 parent 5a92025 commit 19abef6

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/core/dbus.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,16 @@ static int signal_disconnected(sd_bus_message *message, void *userdata, sd_bus_e
131131
assert(message);
132132
assert_se(bus = sd_bus_message_get_bus(message));
133133

134-
if (bus == m->api_bus)
134+
if (bus == m->api_bus) {
135+
log_notice("Got disconnect on API bus.");
135136
bus_done_api(m);
136-
if (bus == m->system_bus)
137+
}
138+
if (bus == m->system_bus) {
139+
/* If we are the system manager, this is already logged by the API bus. */
140+
if (!MANAGER_IS_SYSTEM(m))
141+
log_notice("Got disconnect on system bus.");
137142
bus_done_system(m);
143+
}
138144

139145
if (set_remove(m->private_buses, bus)) {
140146
log_debug("Got disconnect on private connection.");

0 commit comments

Comments
 (0)