From a911bb9ab27ac0eb3bbf4e8b4109e5da9b88eee3 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 6 Feb 2014 17:17:51 +0100 Subject: core: watch SIGCHLD more closely to track processes of units with no reliable cgroup empty notifier When a process dies that we can associate with a specific unit, start watching all other processes of that unit, so that we can associate those processes with the unit too. Also, for service units start doing this as soon as we get the first SIGCHLD for either control or main process, so that we can follow the processes of the service from one to the other, as long as process that remain are processes of the ones we watched that died and got reassigned to us as parent. Similar, for scope units start doing this as soon as the scope controller abandons the unit, and thus management entirely reverts to systemd. To abandon a unit introduce a new Abandon() scope unit method call. --- src/core/scope.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/core/scope.h') diff --git a/src/core/scope.h b/src/core/scope.h index 014b50c765..6c59126422 100644 --- a/src/core/scope.h +++ b/src/core/scope.h @@ -29,6 +29,7 @@ typedef struct Scope Scope; typedef enum ScopeState { SCOPE_DEAD, SCOPE_RUNNING, + SCOPE_ABANDONED, SCOPE_STOP_SIGTERM, SCOPE_STOP_SIGKILL, SCOPE_FAILED, @@ -57,13 +58,13 @@ struct Scope { char *controller; - Set *pids; - sd_event_source *timer_event_source; }; extern const UnitVTable scope_vtable; +int scope_abandon(Scope *s); + const char* scope_state_to_string(ScopeState i) _const_; ScopeState scope_state_from_string(const char *s) _pure_; -- cgit v1.2.3-54-g00ecf