-------- Original Message -------- Subject: Re: Bug#416156: PID handling in init.d is fragile Date: Wed, 28 Mar 2007 04:27:06 +0200 From: Jeroen van Wolffelaar <[EMAIL PROTECTED]> To: José Luis Tallón <[EMAIL PROTECTED]> CC: Jeroen van Wolffelaar <[EMAIL PROTECTED]>, Steve Langasek <[EMAIL PROTECTED]> References: <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> <[EMAIL PROTECTED]>
(Forwarded on behalf of Jeroen) [snip] > I was finishing testing. Everything seems to be fine now :-) > > Please check and re-check as you wish. > (Vorlon, if you possibly can, do that also) Uploaded as NMU, because I actually made some changes. > Changes: > > - function "Daemonize ( const char* pidfile );" Fine. I did put the function back where it was though, instead of moving it way below, because the stuff in between can hang (for example, when failing to connect, it'll indefinitely retry every 15 seconds, causing 'start' to hang). Moving Daemonize to later on was not related to this RC bug. Putting it in its own function isn't either, but is pretty harmless, so ok. > - added support for the "-p pidfile" option Cool. There was a buglet here -- you didn't initialize the var and then only overwrote it with the default if it started with a nulbyte. I changed that to simply always initialize it to the default. I also made pidfile creation predictable -- always create one when running in background mode, instead of only in some cases. > - updated Usage() to reflect new option I updated the manpage too. > - modified initscript. Vastly simplified logic. > -- I also added a couple more "cosmetic" changes: DEFAULT -> > DEFAULTS; test -f -> test -x; Reverted, not related to the RC bug. > I have tested starting / restarting / stopping / re-stopping Added code to not actually fail on second start / fail on second stop that I had already prepared. It now should really work fine in all cases. I also removed dead code from checking the exit state of a 'true'. I removed the "|| true" so that the script just fails right there when it eh, fails. > The behaviour upon some, certain, connection failures is a bit annoying > (upstream), but I can't change those. If you mean that start simply hangs indefinitely there, sorry, that's not just 'a bit annoying', but a showstopper, and actually introduced by your change to where to Daemonize(). > Comments? I'll be up until late... This late :)? --Jeroen -- Jeroen van Wolffelaar [EMAIL PROTECTED] (also for Jabber & MSN; ICQ: 33944357) http://Jeroen.A-Eskwadraat.nl