Re: runit SIGPWR support

2020-02-12 Thread Dewayne Geraghty
Yes Colin, you're right.  PWR is not in the FreeBSD list of signals, per
# kill -l
HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM URG
STOP TSTP CONT CHLD TTIN TTOU IO XCPU XFSZ VTALRM PROF WINCH INFO USR1
USR2 LWP

Also doesn't appear in Open Group Base Specifications Issue 7 list of
signals https://pubs.opengroup.org/onlinepubs/9699919799/
Cheerio.


Re: runit SIGPWR support

2020-02-12 Thread Colin Booth
On Wed, Feb 12, 2020 at 05:25:56PM +0300, innerspacepilot wrote:
> 
> Why not just make runit systems run inside containers out of the box?
> We are talking about one/two lines of code.
> 
> Why can't we be just a little bit more friendly to each other?
> 
> Thanks.
> 
I wasn't trying to be hostile, apologies if it came across that way. As
far as I know SIGPWR is a Linux-specific signal so services that are
aiming for portability will either need to have special handling for
that in the linux case or need to ignore it. Ergo, runit (and all other
POSIX-compliant inits) currently have no special handling around SIGPWR
as they don't understand what it is. 

Is this the right behavior? I don't know. Something like SIGPWR as an
alerting mechanism when you're switched to UPS battery is pretty nice in
a general case but using that as your container shutdown solution
isolates you into a very SysV-specific world. Overriding the default via
lxc.signal.halt will allow you to modify what you send to something that
is within the POSIX spec and allow you to trigger shutdowns the "right"
way. It's a little lame but it is portable, and LXC using a non-portable
signal is a little bit of a bummer.

-- 
Colin Booth


Re: runit SIGPWR support

2020-02-12 Thread innerspacepilot



Why not just make runit systems run inside containers out of the box?
We are talking about one/two lines of code.

Why can't we be just a little bit more friendly to each other?

Thanks.


On 31.01.2020 07:39, Colin Booth wrote:

On Thu, Jan 23, 2020 at 11:44:12PM +0300, innerspacepilot wrote:

Hello!

Would you please implement handling of SIGPWR in runit's init to make
LXD containers shut down properly.
More info here https://github.com/lxc/lxd/issues/1183


What keeps you from updating lxc.signal.halt and using a signal that
runit already understands?