Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 5 Feb 2012 22:46:48 +0100
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        Mikolaj Golub <trociny@freebsd.org>
Cc:        svn-src-head@FreeBSD.org, Guy Helmer <ghelmer@palisadesystems.com>, svn-src-all@FreeBSD.org, Andrey Zonov <andrey@zonov.org>, src-committers@FreeBSD.org
Subject:   Re: svn commit: r230869 - head/usr.sbin/daemon
Message-ID:  <20120205214647.GI30033@garage.freebsd.pl>
In-Reply-To: <86lioh7yz5.fsf@kopusha.home.net>
References:  <201202011641.q11Gf0j6095461@svn.freebsd.org> <20120204074201.GA1694@garage.freebsd.pl> <4F2CEB1D.10607@zonov.org> <27A0A960-F767-4D2C-BF3E-31F73FBF4E28@palisadesystems.com> <86zkcy5ur9.fsf@kopusha.home.net> <20120205093938.GC30033@garage.freebsd.pl> <86lioh7yz5.fsf@kopusha.home.net>

next in thread | previous in thread | raw e-mail | index | archive | help

--STPqjqpCrtky8aYs
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sun, Feb 05, 2012 at 11:27:10PM +0200, Mikolaj Golub wrote:
> Ok, using hastd code as a reference :-) here is my implementation.

- I'd not pass selected signals to the child. The parent can still be
  killed with a whole bunch of different signals that are not passed or
  cannot be caught or the child process handle them gracefully.
  Signals should be send to the PID from the pidfile anyway. If someone
  is sending signals to the parent he has no right to expect well
  behaviour from the parent.

- Now that we handle the pidfile fully in the parent, I'd move dropping
  provileges after fork(2) and pidfile_write(3). This way pidfiles will
  always be created with root privileges and we can forget about all the
  mess with pid directories, etc.

- With the above you can wait for child to exit with simple wait(2).

--=20
Pawel Jakub Dawidek                       http://www.wheelsystems.com
FreeBSD committer                         http://www.FreeBSD.org
Am I Evil? Yes, I Am!                     http://tupytaj.pl

--STPqjqpCrtky8aYs
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.18 (FreeBSD)

iEYEARECAAYFAk8u+McACgkQForvXbEpPzSvqgCg9ndmZ+VXAVgb7SUXpHp7dGAJ
08cAniBzA5lGP0hWm5fFuMwN/cCqH+7n
=eWsn
-----END PGP SIGNATURE-----

--STPqjqpCrtky8aYs--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120205214647.GI30033>