diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2015-01-14 00:48:32 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2015-01-14 00:48:32 +0000 |
commit | d73a8330016fbf172f8e3521b879502b9139a970 (patch) | |
tree | 9368926e55d67bf565cc0f2275e203f464cf193a /src/supervision/s6-supervise.c | |
parent | a6395bee8b2b696c0c74ff23a11944a491c83cc1 (diff) | |
download | s6-d73a8330016fbf172f8e3521b879502b9139a970.tar.xz |
- Parallel build fixv2.0.1.0
- Complete readiness notification via supervise/ready
- Version updated to 2.0.1.0, release candidate
Diffstat (limited to 'src/supervision/s6-supervise.c')
-rw-r--r-- | src/supervision/s6-supervise.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/supervision/s6-supervise.c b/src/supervision/s6-supervise.c index de9b6ea..65cbd9d 100644 --- a/src/supervision/s6-supervise.c +++ b/src/supervision/s6-supervise.c @@ -161,6 +161,8 @@ static void trystart (void) PROG = "s6-supervise (child)" ; selfpipe_finish() ; fd_close(p[0]) ; + if (unlink(S6_SUPERVISE_READY_FILENAME) < 0 && errno != ENOENT) + strerr_warnwu1sys("unlink " S6_SUPERVISE_READY_FILENAME) ; if (flagsetsid) setsid() ; execve("./run", (char *const *)cargv, (char *const *)environ) ; fd_write(p[1], "", 1) ; @@ -264,14 +266,21 @@ static void uptimeout (void) strerr_warnw1x("can't happen: timeout while the service is up!") ; } -static void up_z (void) +static void uplastup_z (int islast) { int wstat = status.pid ; status.pid = 0 ; tain_copynow(&status.stamp) ; announce() ; ftrigw_notify(S6_SUPERVISE_EVENTDIR, 'd') ; - tryfinish(wstat, 0) ; + if (unlink(S6_SUPERVISE_READY_FILENAME) < 0 && errno != ENOENT) + strerr_warnwu1sys("unlink " S6_SUPERVISE_READY_FILENAME) ; + tryfinish(wstat, islast) ; +} + +static void up_z (void) +{ + uplastup_z(0) ; } static void up_o (void) @@ -346,12 +355,7 @@ static void finish_x (void) static void lastup_z (void) { - int wstat = status.pid ; - status.pid = 0 ; - tain_copynow(&status.stamp) ; - announce() ; - ftrigw_notify(S6_SUPERVISE_EVENTDIR, 'd') ; - tryfinish(wstat, 1) ; + uplastup_z(1) ; } static action_t_ref const actions[5][23] = |