On Thu, Nov 18, 2021 at 12:20 PM Dave McGuire <mcguire at neurotica.com> wrote:
On 11/18/21 12:12 PM, Thomas DeBellis wrote:
They do it _today_.
Well, since the last release of SunOS (not Solaris) was in 1994, and
the last release of Ultrix was in 1995..
The use of SIGHUP to reread a config file
comes from, at least, Unix 5th Edition. I
suspect that the practice originated with the
`init` process (usually PID 1) which, on receipt
of SIGHUP, would reread the ttys file to figure
out what typewriters were attached to the
system. Prior to that, I suspect they'd have
to reboot to add a new terminal to the system,
but things from first through 4th edition are
not as well preserved as 5th onwards, so its
hard to tell.
By the time Berkeley was writing things like
inetd, the practice was well known. Does that
make it a "standard?" Not in any formal sense,
but a daemon couldn't receive a SIGHUP in
the usual way an interactive process might,
so piggybacking some special meaning on it
makes a certain amount of sense.
Has it fallen out of a favor? A bit. As Doug
McIllroy put it on the Unix Heritage Society
list a few years ago, signal() primarily existed
to support SIGKILL, not as a principled basis
for IPC. It's racy and doing Real Work in the
context of an upcall from the kernel like a
signal handler is fraught.
- Dan C.