public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] init script guidelines
@ 2005-07-19 16:42 Eric Brown
  2005-07-19 17:22 ` Chris Gianelloni
                   ` (3 more replies)
  0 siblings, 4 replies; 17+ messages in thread
From: Eric Brown @ 2005-07-19 16:42 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 2298 bytes --]

Services that use Gentoo init scripts often report a status of [started]
or
[OK] even though they fail to start.  The most recent bug like this that
I've
found is with snort.  If you have a bad rule, snort will initialize, the
rc-scripts will give it an [OK] status, and then it will die once it
parses the
rules.
 
The real problem is not that the daemons don't return errors, but that
our init
scripts do not make reasonable attempts to verify service startup.  If a
Gentoo
init script claims that a service started, it should make an effort to
check
that the processes are actually running shortly after the script is run,
even if
start-stop-daemon says the parent process initialized.  Relying on the
return
value of start-stop-daemon is simply insufficient for some services.
 
I am aware that there are services that can monitor the status of other
services
(app-admin/mon?) but I think this issue is a little different.  If an
ebuild
developer is aware of an error condition can commonly occur shortly
after a
daemon initializes, why not attempt to catch those errors?  Most of them
could
probably be caught by simply checking to see if the process is still
running
shortly after the script is run.
 
I propose increasing developer awareness of this problem, perhaps
through some
formal guidelines for ebuild developers.  At the very least, I would
like to see
these bugs being acknowledged in bugs.gentoo.org instead of getting the
same old
upstream/it's not our fault response.  We are responsible for our init
scripts,
and they are important to our users.
 
I have 2 ideas for the actual implementation:
 
1) Some kind of check() function in the init.d script, or a generic
check() function
that just checks with ps | grep.  This might typically be called after
having the
init script sleep for a certain amount of time.
 
2) Some kind of special init script that checks registered daemons after
all services
have started. (i.e. it depends on all daemons, or they are put into it's
config file).
With this scheme we could avoid excessive sleeping during startup (to
keep it fast),
And perhaps even keep using service specific check() functions
 
 
Does anyone else think this idea is worth looking into?

 

 

  

 


[-- Attachment #2: Type: text/html, Size: 8233 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2005-08-31 17:42 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-19 16:42 [gentoo-dev] init script guidelines Eric Brown
2005-07-19 17:22 ` Chris Gianelloni
2005-07-19 17:45 ` Mike Frysinger
2005-07-19 18:00 ` Roy Marples
2005-07-19 22:16   ` Francesco R
2005-08-23 14:09   ` Paul de Vrieze
2005-08-31  7:13     ` Roy Marples
2005-08-31  8:05       ` Roy Marples
2005-08-31  8:24         ` Georgi Georgiev
2005-08-31  8:32           ` [gentoo-dev] OT: cvs $Header not substituted Georgi Georgiev
2005-08-31  8:42             ` Brian Harring
2005-08-31  8:54               ` Roy Marples
2005-08-31 10:05                 ` Paul de Vrieze
2005-08-31 10:19                   ` Roy Marples
2005-08-31 13:07                   ` Mike Frysinger
2005-08-31 17:38       ` [gentoo-dev] init script guidelines Roy Marples
2005-07-19 18:14 ` Francesco R

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox