From owner-freebsd-questions@freebsd.org Sat May 14 10:58:39 2016 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE686B3B5D5 for ; Sat, 14 May 2016 10:58:39 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from smtp.infracaninophile.co.uk (smtp.infracaninophile.co.uk [81.2.117.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49B09138A for ; Sat, 14 May 2016 10:58:39 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from liminal.local (liminal.infracaninophile.co.uk [IPv6:2001:8b0:151:1:3636:3bff:fed4:b0d6]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: m.seaman@infracaninophile.co.uk) by smtp.infracaninophile.co.uk (Postfix) with ESMTPSA id B34BBA728 for ; Sat, 14 May 2016 10:58:27 +0000 (UTC) Authentication-Results: smtp.infracaninophile.co.uk; dmarc=none header.from=FreeBSD.org Authentication-Results: smtp.infracaninophile.co.uk/B34BBA728; dkim=none; dkim-atps=neutral Subject: Re: Shell script ignoring / blocking signals To: freebsd-questions@freebsd.org References: <000b01d1ad50$2a928790$7fb796b0$@ymail.com> From: Matthew Seaman Message-ID: <030404da-2588-05c5-00fa-a2b6c32856b1@FreeBSD.org> Date: Sat, 14 May 2016 11:58:17 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <000b01d1ad50$2a928790$7fb796b0$@ymail.com> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="v71fu2DcPiNGi1m7I81pQsPcMKLsxPb2b" X-Virus-Scanned: clamav-milter 0.99.1 at smtp.infracaninophile.co.uk X-Virus-Status: Clean X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on smtp.infracaninophile.co.uk X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 May 2016 10:58:39 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --v71fu2DcPiNGi1m7I81pQsPcMKLsxPb2b Content-Type: multipart/mixed; boundary="16S99fgHUg7TROXENvuAbrEQgLNePRX0A" From: Matthew Seaman To: freebsd-questions@freebsd.org Message-ID: <030404da-2588-05c5-00fa-a2b6c32856b1@FreeBSD.org> Subject: Re: Shell script ignoring / blocking signals References: <000b01d1ad50$2a928790$7fb796b0$@ymail.com> In-Reply-To: <000b01d1ad50$2a928790$7fb796b0$@ymail.com> --16S99fgHUg7TROXENvuAbrEQgLNePRX0A Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable 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 i= s 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 unbloc= k > 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=3Drevision&revision=3D297789 and here for 10.3-RELEASE: https://svnweb.freebsd.org/base?view=3Drevision&revision=3D297204 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 --16S99fgHUg7TROXENvuAbrEQgLNePRX0A-- --v71fu2DcPiNGi1m7I81pQsPcMKLsxPb2b Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQJ8BAEBCgBmBQJXNwTPXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ2NTNBNjhCOTEzQTRFNkNGM0UxRTEzMjZC QjIzQUY1MThFMUE0MDEzAAoJELsjr1GOGkATq44QAJVUXJuSvJvQYW9pMnTHWH1f UJC/B09iEfwQI22+Ag++XZOska7xpjQI2XAEeEg5lG0S5FJpxSPvUN8N7lnZ35GD o+qxG4K6I1ttwlTjUh22X2cnWomYdbBQK0dvYSiUsmUoaMRceh6nZJ0d21JCbxyi 9jgkHR11tdFRph7xI84BM+wU4Ks6LZc9fBjyc0qLxFXPxUXx3y41WfN5vjT10aou UKaMNC2N+s4sBQXJLLIzhFIZABpLxyHNdUVb7vyFqgnK2VbznIw9HzyuWKNOTMKv DydHEZxkD+AUWFmEOIDpXjf0J9zYLlhwbDYUsupjcBEuG60gIjtTWka8NlDlecS5 gjWDBqk+PHU65crsr6xOXPAgpKpIVB4enVXV2QOKAj9cvgeL5t9QRbNOKy2hk9Da xDN95flI/tUVrla7zOpCyL2blXGPoShMkclNApy7aimo/kRE0oGRaJgvTXD+076q NPmUDVNIDHtQlbybKuGtRMAv5jA494aWlU8FvFGbi46kB/rVa2GgwGN0vleHSoem ncaIEAN8l7hBzDd8/wGpbTYIPT82mlUJjy1/qz6dAV6eQi1zj711ma0Lc2OK04Yi a7+PxNR4dRV4bmqU/kSJSIzb0qL6s+FR4S+khC4xhVASsyQDZSkyQ66vNoC6fRZ8 f/85fRd7JdDHFLiFyXZL =TKFb -----END PGP SIGNATURE----- --v71fu2DcPiNGi1m7I81pQsPcMKLsxPb2b--