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>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --]
On Sat, Oct 16, 2010 at 10:47:21AM +0300, Mikolaj Golub wrote:
> Hi,
>
> 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 issue for
> short living, self exiting processes but if one want to start some daemon by
> hook then there is an issue with terminating it.
>
> Here is a hook to reproduce this:
>
> #!/bin/sh
>
> #DAEMON=/etc/rc.d/bsnmpd
> DAEMON=/etc/rc.d/lpd
>
> 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
>
> And after connect event we have lpd running with SIGHUP, SIGINT, SIGTERM and
> SIGCHLD blocked:
>
> 1396 100075 lpd HUP -B
> 1396 100075 lpd INT -B
> 1396 100075 lpd TERM -B
> 1396 100075 lpd CHLD -B
>
> What do you think about the attached patch?
Looks good, I just committed it, thanks!
--
Pawel Jakub Dawidek http://www.wheelsystems.com
pjd@FreeBSD.org http://www.FreeBSD.org
FreeBSD committer Am I Evil? Yes, I Am!
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (FreeBSD)
iEYEARECAAYFAky6LD0ACgkQForvXbEpPzScGwCg0BmKJgtptI7fEWUwaAcMYFRp
bhwAoL1NTTQcvA1aqOmgSeU3oxOP67jA
=kycR
-----END PGP SIGNATURE-----
home |
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20101016225037.GB6765>
