path: stop watching path specs once we triggered the target unit
authorMichal Sekletar <msekleta@redhat.com>
Mon, 9 Sep 2019 12:38:35 +0000 (14:38 +0200)
committerMichael Biebl <biebl@debian.org>
Tue, 19 Nov 2019 08:17:12 +0000 (08:17 +0000)
We start watching them again once we get a notification that triggered
unit entered inactive or failed state.

Fixes: #10503
(cherry picked from commit 8fca6944c2ee20c63d62154c8badddc77170b176)
(cherry picked from commit b294305888da171f393bbb4c3dc0be332e8d50c1)

Gbp-Pq: Name path-stop-watching-path-specs-once-we-triggered-the-targe.patch

src/core/path.c

index 562cd352a3e57b933501c3d8e13cf31975e09f51..ac1289a658c5242171d24485058b0e83b19a2c57 100644 (file)
@@ -480,11 +480,9 @@ static void path_enter_running(Path *p) {
 
         p->inotify_triggered = false;
 
-        r = path_watch(p);
-        if (r < 0)
-                goto fail;
-
         path_set_state(p, PATH_RUNNING);
+        path_unwatch(p);
+
         return;
 
 fail: