Gentoo Archives: gentoo-dev

From: Roy Marples <uberlord@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] init script guidelines
Date: Wed, 31 Aug 2005 07:15:46
Message-Id: 1125472408.11354.7.camel@uberpc.ubernet
In Reply to: Re: [gentoo-dev] init script guidelines by Paul de Vrieze
1 On Tue, 2005-08-23 at 16:09 +0200, Paul de Vrieze wrote:
2 > What I would really like to see in the init system is a way that
3 > initscripts can check whether the services they are responsible for are
4 > still running and then adjust their status accordingly, along with some
5 > nice output. This would then allow the execution of rc-status to give
6 > proper information of actually running daemons, and the "rc" command the
7 > possibility to actually bring online all daemons that should be running.
8 >
9 > Paul
10 >
11
12 Attached is a patch to baselayout-1.12.0_pre6-r3 that allows this.
13 Basically when an init script calls start-stop-daemon --start then we
14 log what it started (and hopefully a pidfile) in
15 ${svcdir}/daemons/${myservice}
16
17 When it's status is asked for (either init.d/foo status or rc-status)
18 then we load this daemon file and check to see if the given daemons are
19 still running. If not then we call init.d/foo stop. We do this instead
20 of just marking the daemon as stopped in-case there is any clean-up code
21 that's needed to be run by the init script.
22
23 For this to work well, start-stop-daemon needs to be used correctly, not
24 just to stop it (like most init scripts seem to). sshd is a popular init
25 script and on most Gentoo'ers systems, so I've attached a patch so show
26 how init script should use start-stop-daemon so this works correctly.
27
28 What do people think about this? Is this worthfile and fixing all the
29 init scripts in the tree to use start-stop-daemon correctly AND for
30 starting up?
31
32 Thanks
33
34 Roy

Attachments

File name MIME type
rc-init-status.patch text/x-patch
sshd-ssd.patch text/x-patch

Replies

Subject Author
Re: [gentoo-dev] init script guidelines Roy Marples <uberlord@g.o>
Re: [gentoo-dev] init script guidelines Roy Marples <uberlord@g.o>