Hi Laurent,
Thanks for s6, I think it's great.
I'm running s6 in a
terminal to control some software under development.
My workflow is, run
s6-svscan, watch logs directed to stdout in my
terminal window, ctrl-c
to bring everything down.
I may be misdiagnosing, but I think what
happens is ctrl-c results in
SIGINT being sent to all processes in the
group, which in this case
includes the s6-supervise processes. They exit
(SIGINT is not handled),
and leave the service process running (now a
child of pid 1).
It would be convenient for my development workflow if
s6-supervise
handled SIGINT in the same way as SIGTERM. I've attached a
(trivial)
patch that does just that, but I don't know if there are
unintended side
effects. Thoughts?
Thanks,
--
Patrick Mahoney
--- a/src/supervision/s6-supervise.c
+++ b/src/supervision/s6-supervise.c
@@ -402,6 +402,7 @@ static void handle_signals (void)
}
break ;
case SIGTERM :
+ case SIGINT :
(*actions[state][V_TERM])() ;
break ;
case SIGHUP :
@@ -458,6 +459,7 @@ int main (int argc, char const *const *argv)
sigemptyset(&set) ;
sigaddset(&set, SIGTERM) ;
sigaddset(&set, SIGHUP) ;
+ sigaddset(&set, SIGINT) ;
sigaddset(&set, SIGQUIT) ;
sigaddset(&set, SIGCHLD) ;
if (selfpipe_trapset(&set) < 0) strerr_diefu1sys(111, "trap signals") ;