nc: trap SIGPIPE failures writing to socket
commit90b780c5e06e58d81272da52a78fb52c777e4fb1
authorKyle J. McKay <mackyle@gmail.com>
Tue, 6 Feb 2018 12:14:21 +0000 (6 04:14 -0800)
committerKyle J. McKay <mackyle@gmail.com>
Tue, 6 Feb 2018 12:14:21 +0000 (6 04:14 -0800)
treeb8ce223b26e9ceb89a5ae849a8fe766bda4e2a41
parent3327bbbcd00d34d85651cb1469d51dbbede7efc7
nc: trap SIGPIPE failures writing to socket

If something goes wrong when writing data to the unix socket that
is a pipe to taskd.pl, then potentially a SIGPIPE could be generated
rather than a simple error result code.

Trap the SIGPIPE (with a nop) so that any error can be handled
normally via the usual status result code reporting.

The post-receive hook already had this, but due to various code
changes since it was originally added it had been rendered ineffective.
Fix that as well.

Since the desired default behavior is not to simply ignore a SIGPIPE,
the default signal handler for SIGPIPE is restored after writing
to the taskd.pl pipe.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
hooks/post-receive
install.sh
jobd/generate-auto-gc-update.sh
jobd/update.sh