]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: log about unit_watch_pid() failing
authorLennart Poettering <lennart@poettering.net>
Tue, 16 Oct 2018 11:47:23 +0000 (13:47 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 16 Oct 2018 11:52:21 +0000 (13:52 +0200)
CID 1237509

src/core/service.c

index 3d065bf487ce9821faf1618adf629d8323b138c0..fa2c6996adc283d88cdf16b3929add0a5d78efa2 100644 (file)
@@ -3648,7 +3648,11 @@ static void service_notify_message(
                         }
                         if (r > 0) {
                                 service_set_main_pid(s, new_main_pid);
-                                unit_watch_pid(UNIT(s), new_main_pid);
+
+                                r = unit_watch_pid(UNIT(s), new_main_pid);
+                                if (r < 0)
+                                        log_unit_warning_errno(UNIT(s), r, "Failed to watch new main PID "PID_FMT" for service: %m", new_main_pid);
+
                                 notify_dbus = true;
                         }
                 }