Re: s6-linux-init: SIGUSR1 and SIGUSR2

From: Jonathan de Boyne Pollard <j.deboynepollard-newsgroups_at_ntlworld.com>
Date: Mon, 22 Aug 2016 09:26:47 +0100 (BST)

Guillermo:
> a) SIGTERM for reboot
> b) SIGUSR1 for halt
> c) SIGUSR2 for poweroff
> d) SIGINT for a programmable CTRL + ALT + Del action
> e) SIGWINCH for a programmable 'keyboard request' action
>
> nosh's system-manager supports e) via the 'kbrequest' target. But for
> compatibility reasons, supports d) on [GNU/]Linux via the
> 'secure-attention-key' target, but not on the BSDs, where SIGINT means
> 'halt'. Supports a) and b) on the BSDs, but not a), because SIGTERM
> means 'enter rescue mode'. And doesn't support a) to c) on
> [GNU/]Linux, because it follows the systemd signal convention (signals
> above SIGRTMIN) there instead.

Or, to put it another way:

On FreeBSD, PC-BSD, and OpenBSD, the nosh system-control and system-manager
tools use (b) and (c) for compatibility with existing BSD tools. But for further
compatibility with existing BSD tools, SIGINT means (orderly shutdown and)
reboot and SIGTERM means bring up rescue mode. To the current FreeBSD/PC-BSD
init and OpenBSD init and accompanying toolset, SIGINT means reboot (indivisibly
from Ctrl+Alt+Del) and SIGTERM means single-user mode. The FreeBSD/PC-BSD and
OpenBSD kernels send SIGINT but don't send SIGWINCH in the first place. If they
did, though, it would be regarded as (e).

On Linux, the nosh system-control and system-manager are designed to use the
Linux kernel and systemd signalling conventions. (d) and (e) are Linux kernel
conventions. (a), (b), and (c) are BSDisms that as Guillermo noted have never
really been the case on Linux at all. (b) actually outright conflicts with a
van Smoorenburg init convention (where it means "restart the initctl server").
 It also conflicts with an upstart convention (where it means "re-connect to
Desktop Bus"). Moreover, upstart and systemd have made the semantics of SIGTERM
into a mess, where for a system-wide systemd/upstart init it means one thing and
for a per-user systemd/upstart init it means something quite different. Neither
meaning is reboot. Orderly shutdown and halt/reboot/poweroff are various
real-time signals, instead.

The systemd real-time signals for orderly shutdown and halt/reboot/poweroff are
also available on FreeBSD and PC-BSD, in fact. Apart from this last, all of the
aforegiven is documented in the system-control and system-manager user manuals.

See https://jdebp.eu./FGA/emergency-and-rescue-mode-bootstrap.html for the
evolution of single-user mode into rescue mode. The nosh system-manager can in
fact do both emergency and rescue modes on FreeBSD/PC-BSD and OpenBSD as well as
on Linux. The BSD bootstraps themselves don't have two flags, though.
Received on Mon Aug 22 2016 - 08:26:47 UTC

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