Thanks for the answer, I understand it better now.To be honest I had to get a little bit used to this unconventional way of shutting down.
I found these arguments a little weak:
you want to be able to recover and get a shell until the very end, and you don't want your pid 1 to accidentally get killed
Since you can get a shell easily in the finish script too: | if -n { mount -o remount,ro / } | shAnd accidentally killing PID 1 would break the supervision tree based approach too, right?
But getting a more advanced recovery method up, e.g. an ssh server when you only have remote access or an agetty instead of PID 1 sh on a desktop machine, will be more reliable under a supervision tree, I can see that. Further, I was wondering about how to implement such a fallback, would: | if -n { mount -o remount,ro / } | foreground { s6-svc -U /run/service/recovery } (With what "recovery" is being a decision of the sysadmin) Something like this hold up well enough?One could also argue that the finish script of s6-svscan is really a last resort and,
if something can be implemented well in another way (as is the case here), it should be.Anyhow, you have convinced me that keeping the supervision tree is the better way.
Finally, if there is anything that could fundamentally be done better in the script, please tell me. This is to everybody here, I am happy about every GNU'ism or util-linux'ism
pointed out in any of the scripts I post,as I try to make all my scripts work with pure POSIX + ( ubase | toybox | busybox ).
I wish you all a nice weekend, Paul
OpenPGP_0x71C7C85A2EA30F62.asc
Description: OpenPGP public key
OpenPGP_signature.asc
Description: OpenPGP digital signature