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)
committerThe Plumber <50238977+systemd-rhel-bot@users.noreply.github.com>
Tue, 22 Oct 2019 14:02:00 +0000 (16:02 +0200)
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)

Resolves: #1763161

src/core/path.c

index 68b13b610a9fb1590b92d25df3e2f789698faa77..5ef178a46ba7425beb6fa88ba8065e494e59a0ad 100644 (file)
@@ -478,11 +478,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: