]> Sergey Matveev's repositories - public-inbox.git/commit
spawn: try to keep signals blocked in spawned child
authorEric Wong <e@80x24.org>
Sat, 18 Jun 2016 10:53:32 +0000 (10:53 +0000)
committerEric Wong <e@80x24.org>
Sat, 18 Jun 2016 21:48:25 +0000 (21:48 +0000)
commite748f75979046724ead380bd00eadc677bdc07e9
treefbcd16686324cc689a1cd1b0de642bc9a9881601
parent1701875544e31d77f65cf467a35c8dd2bcebf8fa
spawn: try to keep signals blocked in spawned child

While we only want to stop our daemons and gracefully destroy
subprocesses, it is common for 'Ctrl-C' from a terminal to kill
the entire pgroup.

Killing an entire pgroup nukes subprocesses like git-upload-pack
breaks graceful shutdown on long clones.  Make a best effort to
ensure git-upload-pack processes are not broken when somebody
signals an entire process group.

Followup-to: commit 37bf2db81bbbe114d7fc5a00e30d3d5a6fa74de5
("doc: systemd examples should only kill one process")
lib/PublicInbox/Spawn.pm
lib/PublicInbox/SpawnPP.pm
t/spawn.t