Gentoo Archives: gentoo-dev

From: Roy Marples <uberlord@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] init script guidelines
Date: Tue, 19 Jul 2005 18:05:02
Message-Id: 1121796031.10337.6.camel@uberpc.ubernet
In Reply to: [gentoo-dev] init script guidelines by Eric Brown
1 On Tue, 2005-07-19 at 12:42 -0400, Eric Brown wrote:
2
3
4 > The real problem is not that the daemons don't return errors, but that our init
5 > scripts do not make reasonable attempts to verify service startup. If a Gentoo
6 > init script claims that a service started, it should make an effort to check
7 > that the processes are actually running shortly after the script is run, even if
8 > start-stop-daemon says the parent process initialized. Relying on the return
9 > value of start-stop-daemon is simply insufficient for some services.
10
11 I agree.
12
13 Infact, rc-services.sh (/lib/rcscripts/sh) has been totally re-written
14 for the baselayout-1.12.x branch. It now intercepts calls to
15 start-stop-daemon and checks if the daemon is still active after a
16 default time of 0.1 (adjustable) seconds. If not, the we assume the
17 daemon failed. This solves many existing bugs :)
18
19 Also, we kill any rogue processes and other such checks when a stop call
20 to start-stop-daemon is made - which is handy for when asterisk fails to
21 start and leaves mpg123 processes lying around :)
22
23 Check it out when baselayout-1.12.0pre1 hits portage!
24
25 Caveat: - some init scripts abuse start-stop-daemon. One example are all
26 courier scripts which pass the env program as a daemon. This is easily
27 worked around, but we fail badly if env then calls a shell script which
28 in turn launches a daemon. Of all the server stuff I run, only couier
29 has this issue - but there may be other programs too. Basically
30 start-stop-daemon should only call daemons!
31
32 http://bugs.gentoo.org/show_bug.cgi?id=98745
33
34 Roy
35
36 --
37 gentoo-dev@g.o mailing list

Replies

Subject Author
Re: [gentoo-dev] init script guidelines Francesco R <vivo@g.o>
Re: [gentoo-dev] init script guidelines Paul de Vrieze <pauldv@g.o>