core: introduce new stop protocol for unit scopes

By specifiy a Controller property when creating the scope a client can
specify a bus name that will be notified with a RequestStop bus signal
when the scope has been asked to shut down, instead of sending SIGTERM
to the scope processes themselves.

https://bugzilla.redhat.com/show_bug.cgi?id=1032695
This commit is contained in:
Lennart Poettering
2014-01-31 17:48:36 +01:00
parent fb818b2ea1
commit 2d4a39e759
5 changed files with 86 additions and 7 deletions
+8
View File
@@ -356,6 +356,14 @@ static int start_transient_scope(
if (r < 0)
return r;
{
const char *unique_id;
sd_bus_get_unique_name(bus, &unique_id);
r = sd_bus_message_append(m, "(sv)", "Controller", "s", unique_id);
if (r < 0)
return r;
}
r = message_start_transient_unit_send(bus, m, error, NULL);
if (r < 0)
return r;