Re: s6-linux-init: SIGUSR1 and SIGUSR2
On 22/08/16 16:29, Martin "eto" Misuth wrote:
> On Mon, 22 Aug 2016 07:26:12 -0700
>
> Colin Booth <cathexis_at_gmail.com> wrote:
>> My own $0.02 is that s6-svscan -S should ignore power state signals
>> (including SIGINT which it currently doesn't ignore).
>
> I haven't really understood this thread, but I think I am starting to
> understand.
>
> Correct me, if I am wrong, but is this about signals, which generate various
> cleanup paths to end normal machine operations aka "curuising" mode?
>
> Because if so, there is problem I hit before, but thought it was PEBKAC on my
> part.
>
> Currently on FreeBSD, when s6-svscan runs as PID1, native "reboot" command makes
> s6-svscan do proper cleanup (I guess it sends signal which is
> correctly interpreted by s6-svscan as shutdown signal). While shutdown does
> "nothing". I guess on that box I need to add -S switch and introduce signal
> handling scripts?
FreeBSD has a different convention.
SIGHUP: Reload /etc/ttys. Since s6 doesn't start getty etc. from
/etc/ttys there no need to handle this signal. I just log it to the
default logger.
SIGINT: Reboot the system. I implemented it as `s6-rc -a -d change`
followed by `s6-svscanctl -i /run/service`.
SIGQUIT: Not used by FreeBSD init. Just log and otherwise ignore the signal.
SIGUSR1: Halt the system. Use `s6-rc -a -d change` to stop all services
and `s6-svscanctl -st /run/service` to halt.
SIGUSR2: Poweroff the system. Use `s6-rc -a -d change` to stop all
services and `s6-svscanctl -pt /run/service` to power down.
It's also a good idea to kill all remaining processes, update the
/entropy file and sync the disks from the s6-svscan ./finish script.
I can upload my /etc/service and /etc/s6-rc/source if you're interested.
Received on Mon Aug 22 2016 - 14:53:48 UTC
This archive was generated by hypermail 2.3.0
: Sun May 09 2021 - 19:44:19 UTC