]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: watch PIDs of scope units right after starting them 9148/head
authorLennart Poettering <lennart@poettering.net>
Thu, 31 May 2018 13:50:46 +0000 (15:50 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 5 Jun 2018 20:06:48 +0000 (22:06 +0200)
Scope units don't have a main or control process we can watch, hence
let's explicitly watch the PIDs contained in them early on, just to make
things more robust and have at least something to watch.

src/core/scope.c

index 0d22c7525b309d72f8e608d7f52f33ce51dfdcc0..5db329604414e006be42763ecbb15da3c54af67e 100644 (file)
@@ -347,6 +347,9 @@ static int scope_start(Unit *u) {
         s->result = SCOPE_SUCCESS;
 
         scope_set_state(s, SCOPE_RUNNING);
+
+        /* Start watching the PIDs currently in the scope */
+        (void) unit_enqueue_rewatch_pids(UNIT(s));
         return 1;
 }