From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by nuthatch.gentoo.org with esmtp (Exim 4.43) id 1Duwdn-0000Zc-NP for garchives@archives.gentoo.org; Tue, 19 Jul 2005 18:16:28 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.13.4/8.13.4) with SMTP id j6JIEoaN005188; Tue, 19 Jul 2005 18:14:50 GMT Received: from mail.pnpitalia.it (ip-pub.fastwebnet.it [85.18.21.122] (may be forged)) by robin.gentoo.org (8.13.4/8.13.4) with ESMTP id j6JIDBZ4029446 for ; Tue, 19 Jul 2005 18:13:11 GMT Received: from localhost (localhost [127.0.0.1]) by mail.pnpitalia.it (Postfix) with ESMTP id 39F827AD553 for ; Tue, 19 Jul 2005 20:14:13 +0200 (CEST) Received: from mail.pnpitalia.it ([127.0.0.1]) by localhost (db [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 27172-09 for ; Tue, 19 Jul 2005 20:14:12 +0200 (CEST) Received: from [192.168.4.153] (unknown [192.168.4.153]) by mail.pnpitalia.it (Postfix) with ESMTP id BBE977AD552 for ; Tue, 19 Jul 2005 20:14:12 +0200 (CEST) Message-ID: <42DD42FB.6040407@gentoo.org> Date: Tue, 19 Jul 2005 20:14:19 +0200 From: Francesco R User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 To: gentoo-dev@lists.gentoo.org Subject: Re: [gentoo-dev] init script guidelines References: <16CC9569DA3E4D41A1D4BC25D7B5A16A473A7C@hercules.magbank.com> In-Reply-To: <16CC9569DA3E4D41A1D4BC25D7B5A16A473A7C@hercules.magbank.com> X-Enigmail-Version: 0.92.0.0 Content-Type: text/plain; charset=windows-1252 X-Virus-Scanned: amavisd-new at db Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by robin.gentoo.org id j6JIEobr005188 X-Archives-Salt: b97e11d4-3fd3-4a4b-8363-f37ba7b7f17d X-Archives-Hash: 8028a022f6bf5933770204b7eb135cfe Eric Brown wrote: > Services that use Gentoo init scripts often report a status of [started= ] or =20 > > [OK] even though they fail to start. The most recent bug like this tha= t I've =20 > > found is with snort. If you have a bad rule, snort will initialize, th= e =20 > > rc-scripts will give it an [OK] status, and then it will die once it pa= rses the =20 > > rules. =20 > > =20 > > The real problem is not that the daemons don't return errors, but that = our init =20 > > scripts do not make reasonable attempts to verify service startup. If = a Gentoo =20 > > init script claims that a service started, it should make an effort to = check =20 > > that the processes are actually running shortly after the script is run= , even if =20 > > start-stop-daemon says the parent process initialized. Relying on the = return =20 > > value of start-stop-daemon is simply insufficient for some services. =20 > > =20 > > I am aware that there are services that can monitor the status of other= services =20 > > (app-admin/mon?) but I think this issue is a little different. If an e= build =20 > > developer is aware of an error condition can commonly occur shortly aft= er a =20 > > daemon initializes, why not attempt to catch those errors? Most of the= m could =20 > > probably be caught by simply checking to see if the process is still ru= nning =20 > > shortly after the script is run. =20 > > =20 > > I propose increasing developer awareness of this problem, perhaps throu= gh some =20 > > formal guidelines for ebuild developers. At the very least, I would li= ke to see =20 > > these bugs being acknowledged in bugs.gentoo.org instead of getting the= same old =20 > > upstream/it's not our fault response. We are responsible for our init = scripts, =20 > > and they are important to our users. =20 > > =20 > > I have 2 ideas for the actual implementation: =20 > > =20 > > 1) Some kind of check() function in the init.d script, or a generic che= ck() function =20 > > that just checks with ps | grep. This might typically be called after = having the =20 > > init script sleep for a certain amount of time. =20 > > =20 > > 2) Some kind of special init script that checks registered daemons afte= r all services =20 > > have started. (i.e. it depends on all daemons, or they are put into it=92= s config file). =20 > > With this scheme we could avoid excessive sleeping during startup (to k= eep it fast), =20 > > And perhaps even keep using service specific check() functions =20 > > =20 > > Does anyone else think this idea is worth looking into? =20 > http://bugs.gentoo.org/show_bug.cgi?id=3D90471 We managed this checking for the socket mysql always create on *nix . But whit a timeout of five seconds if there is no error message nor socket in that time the script assume the server started. I'm the first to say that this need to be improved but it's a start. --=20 gentoo-dev@gentoo.org mailing list