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; 25+ 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] 25+ messages in thread
* RE: [gentoo-dev] init script guidelines
@ 2005-07-19 18:08 Eric Brown
  2005-07-19 18:40 ` Chris Gianelloni
  2005-07-19 20:03 ` Mike Frysinger
  0 siblings, 2 replies; 25+ messages in thread
From: Eric Brown @ 2005-07-19 18:08 UTC (permalink / raw
  To: gentoo-dev

A few responses:
(Please forgive the lack of normal formatting)

1) To Chris Gianelloni

I really do agree that it's silly for a daemon to lie about it's
initialization status.  However, after actually haven taken some of
these issues upstream (in particular Apache 1.3).  I realized that the
upstream devs don't really consider these bugs all of the time.  In
Apache's case, it's a bug, but one that's never going to be fixed in 1.3
(2.0 supposedly fixes it).  I think there was one case where pure-ftpd
actually fixed one of these bugs when I reported it.

My point is that Snort and Apache are not alone in this, so I suppose
quite a few upstream developers just disagree with us on what proper
initialization means.  Why should our users suffer?


2) To Mike Frysinger

Most of these services are pretty common, and the suckage is usually
limited to this area of initialization =)

I do see how timing could be an issue for sleeps, but I would personally
much rather have a timeout variable in conf.d somewhere rather than no
check at all.

I would also much rather have a simple check be performed that produced
false positives itself (which is what the init scripts are doing now),
as long as it cut down on the total number of false positives.


3) To anyone else

So far it looks like developer awareness is the best we can do?
What about making standard functions or check services available to help
developers who are aware and need to use them?

Even if developers just become willing to add checks, that would be
great.  Right now most devs simply rely on upstream (although I think
upstream should certainly be a part of each case).

-- 
gentoo-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 25+ messages in thread
* RE: [gentoo-dev] init script guidelines
@ 2005-07-19 19:39 Eric Brown
  0 siblings, 0 replies; 25+ messages in thread
From: Eric Brown @ 2005-07-19 19:39 UTC (permalink / raw
  To: gentoo-dev

Not everyone can patch them, more people would be capable of writing
half-baked hacks that resolve most of the issues.

Anyway I guess the new baselayout sounds promising here.

> My point is that Snort and Apache are not alone in this, so I suppose
> quite a few upstream developers just disagree with us on what proper
> initialization means.  Why should our users suffer?

They shouldn't, but that doesn't mean implementing some half-baked hack
to resolve the situation.  It might be better to instead patch the
daemon in question and send the patches upstream.  Upstream developers
(usually) are much more willing to make changes when you've done the
work for them... ;]



-- 
gentoo-dev@gentoo.org mailing list



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

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

Thread overview: 25+ 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
  -- strict thread matches above, loose matches on Subject: below --
2005-07-19 18:08 Eric Brown
2005-07-19 18:40 ` Chris Gianelloni
2005-07-19 20:43   ` Michael Cummings
2005-07-19 21:07     ` Chris Gianelloni
2005-07-19 21:53   ` Martin Schlemmer
2005-07-20  6:30     ` Roy Marples
2005-07-19 20:03 ` Mike Frysinger
2005-07-19 19:39 Eric Brown

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