Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Feb 2012 10:06:01 +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:  <20120208090600.GA1308@garage.freebsd.pl>
In-Reply-To: <86liodu3me.fsf@in138.ua3>
References:  <27A0A960-F767-4D2C-BF3E-31F73FBF4E28@palisadesystems.com> <86zkcy5ur9.fsf@kopusha.home.net> <20120205093938.GC30033@garage.freebsd.pl> <86lioh7yz5.fsf@kopusha.home.net> <20120205214647.GI30033@garage.freebsd.pl> <86sjiov29o.fsf@in138.ua3> <20120206082706.GA1324@garage.freebsd.pl> <86wr7zmy8f.fsf@kopusha.home.net> <20120206221742.GA1336@garage.freebsd.pl> <86liodu3me.fsf@in138.ua3>

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

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

On Wed, Feb 08, 2012 at 10:32:41AM +0200, Mikolaj Golub wrote:
>=20
> On Mon, 6 Feb 2012 23:17:43 +0100 Pawel Jakub Dawidek wrote:
>=20
>  PJD> On Mon, Feb 06, 2012 at 11:46:24PM +0200, Mikolaj Golub wrote:
>=20
>  >> Thanks. The updated version is attached.
>=20
>  PJD> Looks good to me.
>=20
> Thanks. But I still think that adding some signal handling is a good idea=
=2E I
> agree that there may be no sense in trying to handle many different signa=
ls,
> but handling SIGTERM (software termination signal :-) nicely looks like a=
 good
> thing.

Ok:) In that case could you break you patch into one that only fixes the
problem we discussed and the other that implements new functionality?

> This would solve problems like stale pid files after shutdown or orphaned
> programs (again with stale pid files and a possibility to start another
> instance) due to a user mistakenly terminated the supervising daemons.
>=20
> Also it is possible then to add "automatic restart" option, as Andrey has
> proposed.
>=20
> Here is the patch that does it. It also change proctitle to make identify=
ing a
> a supervisor with its charge.

I'd prefer to see more general solution to that problem, but I guess
this can't hurt. I've only one suggestion based on my experience.
Before you restart the program, wait for 1 second. This helps a lot when
you have misbehaving program or some misconfiguration that make the
process to exit immediately.

> A technical question concerning the patch :-). Does sombody know if
> sigwaitinfo() may be interrupted in my case and I should check for EINTR,=
 as I
> do in the patch?

Calling sigwaitinfo() with second argument equal to NULL is equivalent
to calling sigwait(). The only difference is that sigwait() cannot be
interrupted by signal, thus never sets errno to EINTR. Why not to use
just that?

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

--6c2NcOVqGQ03X4Wi
Content-Type: application/pgp-signature

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

iEYEARECAAYFAk8yOvgACgkQForvXbEpPzQNVwCgxOxaz6gr8eiuvKD6Fj7qKCem
JuMAnib1UpQbb2phqNIg5aeYH6ILy+3S
=gjll
-----END PGP SIGNATURE-----

--6c2NcOVqGQ03X4Wi--



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