On Wed, Aug 5, 2015 at 1:08 AM, Ido Perlmuter <[email protected]> wrote: > Hi everyone! > > I've released the first version of the shell I was working on. I put up a > simple website for it in https://ido50.github.io/Svsh. There's some > screenshots there to give you an idea of how it looks, and explanations of > what you can do with it. This version supports runit, daemontools, s6 and > perp. > > Supported commands: > * status - get a list of services, their statuses, uptimes/downtimes, pids > * start - start a list of services > * stop - stop a list of services (do not start again) > * restart - restart a list of services > * signal - send a unix signal to services > * fg - move service to the foreground > * rescan - trigger base directory rescan (s6 and perp only) > * terminate - terminate the supervisor and all services (s6 and perp only) > > Thanks, > Ido Perlmuter.
Cool. For s6, terminate should run s6-svscanctl -t $supervise. -7 is mostly used to shut down the host when s6 is being run as an init. Reading the man page for runsvdir, if you send runsvdir SIGHUP it'll TERM all its attendant runsv processes and then quit. Sending SIGTERM to runsv causes it to TERM all children, and close stdin on all loggers which (assuming the logger is well behaved) will shut it down as well. There isn't a helpful interface into runsvdir like there is with s6-svscan or perpd, but assuming you can figure out a half decent way to get a signal to the correct runsvdir, you can add terminate handling for runit. Terminate for daemontools is a bit more complicated since svscan doesn't directly support shutting down its supervisors when it dies. Assuming you can safely get the correct pid for svscan the following works: kill $svscan-pid svc -dx $supervise/*/log $supervise/* It's race-prone since something might resurrect svscan before the svc takes effect. This isn't a huge deal since supervise (and runsv, and s6-supervise) exit immeidately if they are run against an already supervised directory but it'll be noisy for a bit while your old supervisors finish cleaning up. Cheers! -Colin -- "If the doors of perception were cleansed every thing would appear to man as it is, infinite. For man has closed himself up, till he sees all things thru' narrow chinks of his cavern." -- William Blake
