Date: Sun, 17 Oct 2010 00:50:37 +0200 From: Pawel Jakub Dawidek <pjd@FreeBSD.org> To: Mikolaj Golub <to.my.trociny@gmail.com> Cc: freebsd-fs@freebsd.org Subject: Re: hastd: hooks run with masked signals Message-ID: <20101016225037.GB6765@garage.freebsd.pl> In-Reply-To: <86eibq60l2.fsf@kopusha.home.net> References: <86eibq60l2.fsf@kopusha.home.net>
next in thread | previous in thread | raw e-mail | index | archive | help
--RASg3xLB4tUQ4RcS
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
On Sat, Oct 16, 2010 at 10:47:21AM +0300, Mikolaj Golub wrote:
> Hi,
>=20
> Main hastd process uses sigprocmask(2)/sigtimedwait(2) API. Currently when
> a hook is started it inherits signal mask from the main process, so hooks=
are
> run with SIGHUP, SIGINT, SIGTERM and SIGCHLD blocked. This is not an issu=
e for
> short living, self exiting processes but if one want to start some daemon=
by
> hook then there is an issue with terminating it.=20
>=20
> Here is a hook to reproduce this:
>=20
> #!/bin/sh
>=20
> #DAEMON=3D/etc/rc.d/bsnmpd
> DAEMON=3D/etc/rc.d/lpd
>=20
> case $1 in
> start|connect)
> ${DAEMON} onestart
> ;;
> stop|disconnect)
> ${DAEMON} onestop
> ;;
> status)
> ${DAEMON} onestatus
> ;;
> role)
> exit 0
> ;;
> *)
> echo "usage: $0 stop|start|status|role|connect|disconnect"
> exit 1
> ;;
> esac
>=20
> And after connect event we have lpd running with SIGHUP, SIGINT, SIGTERM =
and
> SIGCHLD blocked:
>=20
> 1396 100075 lpd HUP -B
> 1396 100075 lpd INT -B
> 1396 100075 lpd TERM -B
> 1396 100075 lpd CHLD -B
>=20
> What do you think about the attached patch?
Looks good, I just committed it, thanks!
--=20
Pawel Jakub Dawidek http://www.wheelsystems.com
pjd@FreeBSD.org http://www.FreeBSD.org
FreeBSD committer Am I Evil? Yes, I Am!
--RASg3xLB4tUQ4RcS
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (FreeBSD)
iEYEARECAAYFAky6LD0ACgkQForvXbEpPzScGwCg0BmKJgtptI7fEWUwaAcMYFRp
bhwAoL1NTTQcvA1aqOmgSeU3oxOP67jA
=kycR
-----END PGP SIGNATURE-----
--RASg3xLB4tUQ4RcS--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20101016225037.GB6765>
