Merge pull request #24 from westermo/wmo/2.4

Assert svc condition only when PID file has been created/updated

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2016-04-10 19:50:16 +02:00
commit d7d45b65d0
3 files changed
+22 -4

No files matched your search

+6
View File
@@ -153,6 +153,9 @@ static int service_start(svc_t *svc)
}
#endif
/* Declare we're waiting for svc to create its pidfile */
svc_starting(svc);
/* Block sigchild while forking. */
sigemptyset(&nmask);
sigaddset(&nmask, SIGCHLD);
@@ -341,6 +344,9 @@ static int service_restart(svc_t *svc)
if (verbose)
print_desc("Restarting ", svc->desc);
/* Declare we're waiting for svc to re-assert/touch its pidfile */
svc_starting(svc);
_d("Sending SIGHUP to PID %d", svc->pid);
err = kill(svc->pid, SIGHUP);