From owner-svn-src-all@FreeBSD.ORG Wed Feb 8 09:07:16 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B695106566B; Wed, 8 Feb 2012 09:07:16 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id E40248FC14; Wed, 8 Feb 2012 09:07:15 +0000 (UTC) Received: from localhost (58.wheelsystems.com [83.12.187.58]) by mail.dawidek.net (Postfix) with ESMTPSA id 6F885262; Wed, 8 Feb 2012 10:07:13 +0100 (CET) Date: Wed, 8 Feb 2012 10:06:01 +0100 From: Pawel Jakub Dawidek To: Mikolaj Golub Message-ID: <20120208090600.GA1308@garage.freebsd.pl> 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> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="6c2NcOVqGQ03X4Wi" Content-Disposition: inline In-Reply-To: <86liodu3me.fsf@in138.ua3> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, Guy Helmer , svn-src-all@FreeBSD.org, Andrey Zonov , src-committers@FreeBSD.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 09:07:16 -0000 --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--