From b36c6e486f04e4f29a0c88065eb84d0107ceb136 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Mon, 19 Jun 2017 14:31:46 +0000 Subject: Add commented code to s6-rc to kill oneshots. Just in case. --- src/s6-rc/s6-rc.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/s6-rc/s6-rc.c b/src/s6-rc/s6-rc.c index fe7af67..7f573f1 100644 --- a/src/s6-rc/s6-rc.c +++ b/src/s6-rc/s6-rc.c @@ -204,8 +204,7 @@ static void failure_longrun (unsigned int i, int h) char const *newargv[5] = { S6_EXTBINPREFIX "s6-svc", "-d", "--", fn, 0 } ; memcpy(fn, live, livelen) ; memcpy(fn + livelen, "/scandir/", 9) ; - memcpy(fn + livelen + 9, db->string + db->services[i].name, svdlen) ; - fn[livelen + 9 + svdlen] = 0 ; + memcpy(fn + livelen + 9, db->string + db->services[i].name, svdlen+1) ; if (!child_spawn0(newargv[0], newargv, (char const *const *)environ)) strerr_warnwu2sys("spawn ", newargv[0]) ; } @@ -279,6 +278,19 @@ static void on_failure (unsigned int i, int h, int crashed, unsigned int code) } } +/* +static inline void kill_oneshots (void) +{ + char fn[livelen + S6RC_ONESHOT_RUNNER_LEN + 10] ; + char const *newargv[5] = { S6_EXTBINPREFIX "s6-svc", "-h", "--", fn, 0 } ; + memcpy(fn, live, livelen) ; + memcpy(fn + livelen, "/scandir/", 9) ; + memcpy(fn + livelen + 9, S6RC_ONESHOT_RUNNER, S6RC_ONESHOT_RUNNER_LEN+1) ; + if (!child_spawn0(newargv[0], newargv, (char const *const *)environ)) + strerr_warnwu2sys("spawn ", newargv[0]) ; +} +*/ + static inline void kill_longruns (void) { unsigned int j = npids ; @@ -325,6 +337,7 @@ static int handle_signals (int h) case SIGINT : if (verbosity >= 2) strerr_warnw3x("received ", sig_name(sig), ", aborting longrun transitions") ; + /* kill_oneshots() ; */ kill_longruns() ; break ; default : strerr_dief1x(101, "inconsistent signal state") ; -- cgit v1.2.3