On Tue, Sep 8, 2015 at 10:04 PM, Steve Litt <sl...@troubleshooters.com> wrote: > > Is s6-rc something you add to s6, or is it a totally different thing? > One more bit about this. s6-rc sits on top of s6 and emits s6-svc and s6-sudo commands as necessary. For example, a dry run taking down sshd on my laptop: root@radon:~# s6-rc -n0 -d change sshd s6-rc-dryrun: /package/admin/s6/command/s6-svc -dwD -T 0 -- /run/s6/rc/scandir/sshd-srv s6-rc-dryrun: /package/admin/s6/command/s6-svc -dwD -T 0 -- /run/s6/rc/scandir/sshd-log
Ignoring the s6-rc-dryrun part, I have a bundle named sshd (containing both sshd-srv and sshd-log). If I tell s6-rc to bring down sshd, it'll tell s6-svc to stop sshd, wait until sshd has completely exited (including any ./finish script), and then do the same with the logger. Larger bundles, such as taking down my entire networking stack, look like this: root@radon:~# s6-rc -n0 -d change ok-lan s6-rc-dryrun: /package/admin/s6/command/s6-svc -dwD -T 0 -- /run/s6/rc/scandir/sshd-srv s6-rc-dryrun: /package/admin/s6/command/s6-svc -dwD -T 0 -- /run/s6/rc/scandir/ntpd-srv s6-rc-dryrun: /package/admin/s6/command/s6-svc -dwD -T 0 -- /run/s6/rc/scandir/ntpd-log s6-rc-dryrun: /package/admin/s6/command/s6-svc -dwD -T 0 -- /run/s6/rc/scandir/dnsmasq-srv s6-rc-dryrun: /package/admin/s6/command/s6-svc -dwD -T 0 -- /run/s6/rc/scandir/sshd-log s6-rc-dryrun: /package/admin/s6/command/s6-svc -dwD -T 0 -- /run/s6/rc/scandir/wicd-srv s6-rc-dryrun: /package/admin/s6/command/s6-svc -dwD -T 0 -- /run/s6/rc/scandir/dnsmasq-log s6-rc-dryrun: /package/admin/s6/command/s6-svc -dwD -T 0 -- /run/s6/rc/scandir/wicd-log In this case it takes down the two leaf services that nothing depends on (sshd-srv and ntpd-srv), then stops the services that are now the leaf services (sshd-log, ntpd-log, dnsmasq-srv), then the next new leaf services (wicd-srv, dnsmasq-log), and finally the lone wicd-log that nothing depends on. Startup is, predictably the opposite: root@radon:~# s6-rc -n1000 -u change ok-lan s6-rc-dryrun: /package/admin/s6/command/s6-svc -uwu -T 0 -- /run/s6/rc/scandir/wicd-log s6-rc-dryrun: /package/admin/s6/command/s6-svc -uwu -T 0 -- /run/s6/rc/scandir/sshd-log s6-rc-dryrun: /package/admin/s6/command/s6-svc -uwu -T 0 -- /run/s6/rc/scandir/ntpd-log s6-rc-dryrun: /package/admin/s6/command/s6-svc -uwu -T 0 -- /run/s6/rc/scandir/dnsmasq-log s6-rc-dryrun: /package/admin/s6/command/s6-svc -uwu -T 0 -- /run/s6/rc/scandir/wicd-srv s6-rc-dryrun: /package/admin/s6/command/s6-svc -uwu -T 0 -- /run/s6/rc/scandir/sshd-srv s6-rc-dryrun: /package/admin/s6/command/s6-svc -uwu -T 0 -- /run/s6/rc/scandir/dnsmasq-srv s6-rc-dryrun: /package/admin/s6/command/s6-svc -uwu -T 0 -- /run/s6/rc/scandir/ntpd-srv You may notice that the ordering on loggers vs other services is different. That's because loggers don't depend on anything changing in this example so s6-rc will get those running first before attending to anything else. Cheers! -- "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