summaryrefslogtreecommitdiff
path: root/src/core/service.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-07-01 00:03:57 +0200
committerLennart Poettering <lennart@poettering.net>2013-07-01 00:18:00 +0200
commit6c12b52e19640747e96f89d85422941a23dc6b29 (patch)
tree735f7aa8c36d8e30827f36e3891032a92cab6f2d /src/core/service.c
parenta00963a2e4e98c0e4ef477b63b70c5e71d65fdc1 (diff)
core: add new "scope" unit type for making a unit of pre-existing processes
"Scope" units are very much like service units, however with the difference that they are created from pre-existing processes, rather than processes that systemd itself forks off. This means they are generated programmatically via the bus API as transient units rather than from static configuration read from disk. Also, they do not provide execution-time parameters, as at the time systemd adds the processes to the scope unit they already exist and the parameters cannot be applied anymore. The primary benefit of this new unit type is to create arbitrary cgroups for worker-processes forked off an existing service. This commit also adds a a new mode to "systemd-run" to run the specified processes in a scope rather then a transient service.
Diffstat (limited to 'src/core/service.c')
-rw-r--r--src/core/service.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/core/service.c b/src/core/service.c
index 6f18cbf759..2bc0dc5877 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -1617,6 +1617,7 @@ static int service_coldplug(Unit *u) {
s->deserialized_state == SERVICE_FINAL_SIGTERM ||
s->deserialized_state == SERVICE_FINAL_SIGKILL ||
s->deserialized_state == SERVICE_AUTO_RESTART) {
+
if (s->deserialized_state == SERVICE_AUTO_RESTART || s->timeout_start_usec > 0) {
usec_t k;
@@ -2144,7 +2145,6 @@ static void service_kill_control_processes(Service *s) {
return;
p = strappenda(UNIT(s)->cgroup_path, "/control");
-
cg_kill_recursive(SYSTEMD_CGROUP_CONTROLLER, p, SIGKILL, true, true, true, NULL);
}
@@ -3322,8 +3322,7 @@ static void service_notify_cgroup_empty_event(Unit *u) {
assert(u);
- log_debug_unit(u->id,
- "%s: cgroup is empty", u->id);
+ log_debug_unit(u->id, "%s: cgroup is empty", u->id);
switch (s->state) {