]> git.tuebingen.mpg.de Git - dss.git/commit - dss.c
Kill children on fatal errors.
authorAndre Noll <maan@systemlinux.org>
Wed, 16 Oct 2013 12:17:46 +0000 (14:17 +0200)
committerAndre Noll <maan@systemlinux.org>
Wed, 16 Oct 2013 12:28:33 +0000 (14:28 +0200)
commit19982b7b17a603bd4a0b47c724b4e830daaf88d9
treecf4c416e2795042bc41f6a6389f75ebb71a3380f
parent20f8c7d5e2b7985137e89143005f4b7b15ae59d4
Kill children on fatal errors.

If dss is about to die because it received SIGINT or SIGTERM, we first
restart the rsync process by sending SIGCONT, then send SIGTERM to
both the rsync and the rm process to get rid of any child processes.

This works fine, but there are other fatal errors for which we miss
to clean up as thoroughly, most importantly if there is not enough
free disk space for a single snapshot.

This patch moves the signal-related cleanup part to the new function
kill_children(), and changes handle_signal() and com_run() to call
this function right before the exit hook is invoked.
dss.c