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>
Thu, 2 Oct 2014 15:40:17 +0000 (16:40 +0100)
commit4d2ca2c03161bbd23f7a3f7850449f5fe48b63c3
treed88540339341a9a493c4907b7ba7cfa71a040864
parent7a660e3737ea64c7a2a3c313bfed195f5924a036
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