Shell script ignoring / blocking signals

Matthew Seaman matthew at FreeBSD.org
Sat May 14 10:58:39 UTC 2016


On 13/05/2016 20:46, Andrew Wood via freebsd-questions wrote:
> If I run the script directly everything works fine, but if the script is run
> from inside another shell script the signals are blocked (set to ignore) as
> indicated by procstat.

> Can someone please explain to me why this is happening and how I unblock
> them?

Hmmm... There was a problem with signal masks being propagated across
exec() call for a while, right around the time 10.3-RELEASE was
happening.  This is where the problem was fixed for STABLE-10:

https://svnweb.freebsd.org/base?view=revision&revision=297789

and here for 10.3-RELEASE:

https://svnweb.freebsd.org/base?view=revision&revision=297204

For this to bite you, you'ld need to be running a version of the OS with
an affected version of tcsh, and your shell needs to be descended from a
tcsh process somehow (remember that tcsh is root's default shell, so
this is more common than you might think.)

	Cheers,

	Matthew


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 931 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20160514/ff5f22d0/attachment.sig>


More information about the freebsd-questions mailing list