summaryrefslogtreecommitdiff
path: root/src/run
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-01-31 17:45:13 +0100
committerLennart Poettering <lennart@poettering.net>2014-01-31 17:48:36 +0100
commit2d4a39e759c4ab846ad8a546abeddd40bc8d736e (patch)
tree6076c82b7c28bc2f80570b72427cc27a2ed28357 /src/run
parentfb818b2ea194ec182aa3e776d38883dc615910a1 (diff)
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
Diffstat (limited to 'src/run')
-rw-r--r--src/run/run.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/run/run.c b/src/run/run.c
index 1b14e40e4d..b9e1700d33 100644
--- a/src/run/run.c
+++ b/src/run/run.c
@@ -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;