diff options
author | William Hubbs <w.d.hubbs@gmail.com> | 2017-05-11 11:32:24 -0500 |
---|---|---|
committer | William Hubbs <w.d.hubbs@gmail.com> | 2017-05-11 11:36:42 -0500 |
commit | df027ca4722c8755b23a65db75728b835ccca807 (patch) | |
tree | c055384375ba0169fa7b2c5936cba47cecccf561 /src/rc | |
parent | 4c89e3f5fa1c65ccd0c843f98e4013c2085f243f (diff) |
supervise-daemon: fix our status when we give up on the child process
Diffstat (limited to 'src/rc')
-rw-r--r-- | src/rc/supervise-daemon.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/rc/supervise-daemon.c b/src/rc/supervise-daemon.c index 76c9d426..13aba1a3 100644 --- a/src/rc/supervise-daemon.c +++ b/src/rc/supervise-daemon.c @@ -676,10 +676,12 @@ int main(int argc, char **argv) * result would be the same. */ if (pidfile && exists(pidfile)) unlink(pidfile); - if (svcname) + if (svcname) { rc_service_daemon_set(svcname, exec, (const char *const *)argv, pidfile, false); + rc_service_mark(svcname, RC_SERVICE_STOPPED); + } exit(EXIT_SUCCESS); } @@ -780,6 +782,14 @@ int main(int argc, char **argv) } } + if (pidfile && exists(pidfile)) + unlink(pidfile); + if (svcname) { + rc_service_daemon_set(svcname, exec, + (const char *const *)argv, + pidfile, false); + rc_service_mark(svcname, RC_SERVICE_STOPPED); + } exit(EXIT_SUCCESS); } else if (child_pid == 0) child_process(exec, argv); |