Re: s6-svscan & SIGPWR

From: Laurent Bercot <>
Date: Mon, 14 Mar 2016 19:18:24 +0100

On 14/03/2016 17:49, Jan Bramkamp wrote:
> The correct solution would be to teach s6-svscan about SIGPWR and proxy it to
> .s6-svscan/SIGPWR.


  SIGPWR is not a "traditional" signal to use to ask for a normal shutdown,
and it is a design mistake in lxc-stop to use it. SIGPWR has very specific
semantics: "the power went down, we are now running on UPS, please shut down
as soon as possible", which is not exactly the same thing as "please shut down
cleanly" - even if in practice the implementation would likely be the same.

  The traditional signal to ask for a reboot is SIGINT.

  There is no traditional signal to ask for a shutdown.
  - sysvinit "shutdown" only sends a command to init via /dev/initctl, which is
the equivalent of using s6-svscanctl to send a command to s6-svscan via its
control fifo.
  - suckless init uses SIGUSR1 for "poweroff" and cannot handle "halt"
  - busybox init uses SIGUSR1 for "halt" and SIGUSR2 for "poweroff"
  - I don't even want to know what systemd does. A DBus message, probably.

  So, there's no real historical precedent here, and there are a few signals
to choose from - but SIGPWR is not a good choice, and lxc should be fixed.

  The correct workaround is indeed to use the -s option to s6-svscan and
write appropriate .s6-svscan/SIG* scripts to handle various signals in a
personalized way.

Received on Mon Mar 14 2016 - 18:18:24 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:44:19 UTC