summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2017-06-19 14:31:46 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2017-06-19 14:31:46 +0000
commitb36c6e486f04e4f29a0c88065eb84d0107ceb136 (patch)
tree0b20593e21680f83a796e4861a176466c655e01a
parentce49b0504c523820be6ba33ac370da19bf75d9eb (diff)
downloads6-rc-b36c6e486f04e4f29a0c88065eb84d0107ceb136.tar.xz
Add commented code to s6-rc to kill oneshots. Just in case.
-rw-r--r--src/s6-rc/s6-rc.c17
1 files 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") ;