]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/core/service.c
core: fix detection of dead processes
[thirdparty/systemd.git] / src / core / service.c
index 51297846f9af8a9e3cf471c0b847936f590fb3ad..3a2ef015708311fd6bb3a0a838428c8504eb5407 100644 (file)
@@ -1376,6 +1376,14 @@ static int service_load_pid_file(Service *s, bool may_warn) {
                 return -ESRCH;
         }
 
+        if (get_process_state(pid) == 'Z') {
+                if (may_warn)
+                        log_info_unit(UNIT(s)->id,
+                                      "PID "PID_FMT" read from file %s is a zombie.",
+                                      pid, s->pid_file);
+                return -ESRCH;
+        }
+
         if (s->main_pid_known) {
                 if (pid == s->main_pid)
                         return 0;