chiark / gitweb /
process: Introduce afterfork()
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 27 Sep 2014 10:10:06 +0000 (11:10 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 29 Sep 2014 15:20:01 +0000 (16:20 +0100)
commit6ec6ff78fc906177a1f5ef6f432ed1d61409e995
treed4c2450b407d60c5750ace8e43461123c2af823e
parentcc1258e84391946d19c9900f64ad3a39bd31f57f
process: Introduce afterfork()

Rework set_default_signals into afterfork, which does the sigprocmask
too.  This is necessary for processes we fork after
setup_signal_handling(), which otherwise inherit our blocking mask and
non-default handlers.

Call it after each fork() (except the ones we use for daemonising).
As a consequence:
 - hackypar children will die if they get a terminating signal
 - our subprocesses such as `route' and `ifconfig' will inherit
   reasonable signal setups
 - it will be correct to call udp_make_socket during phase RUN
   (previously any authbind would get a strange signal setup)

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
hackypar.c
process.c
secnet.h
udp.c