1 |
On Mon, 2004-05-03 at 11:05, Paul de Vrieze wrote: |
2 |
> -----BEGIN PGP SIGNED MESSAGE----- |
3 |
> Hash: SHA1 |
4 |
> |
5 |
> On Monday 03 May 2004 10:50, Allen D Parker wrote: |
6 |
> > We can actually probably do this in bash fairly simply (although |
7 |
> > unless each service is started in sequence or in a seperate |
8 |
> > shellspace, it might be a problem) parallel start + bash variables = |
9 |
> > nastiness. |
10 |
> > |
11 |
> > for each initscript SVCNAME="apache2" |
12 |
> > then in the actual runscript, something like this would do just fine |
13 |
> > (imho) for 99% of what would need to be supported: |
14 |
> > |
15 |
> > SVCHOME=`whereis ${SVCNAME} | cut -d " " -f 2` |
16 |
> > if ${SVCNAME} != `ps aux | grep ${SVCHOME}`; then |
17 |
> > /etc/init.d/${SVCNAME} zap && |
18 |
> > /etc/init.d/${SVCNAME} start |
19 |
> > else |
20 |
> > SVC_STATUS="alive" |
21 |
> > fi |
22 |
> |
23 |
> I was more thinking of providing an extra function (say "status()") that |
24 |
> would have a positive result if the service is actually running and a |
25 |
> negative result if it is not. The handler script/program should then be |
26 |
> able to handle this function. |
27 |
> |
28 |
|
29 |
There is one that can be overridden. Also have a look at |
30 |
/lib/rcscripts/sh/rc-daemon.sh - yeah, its crude, its very alpha (did |
31 |
it in a night some months back), but it was supposed to be generic |
32 |
daemon handling, with checking of pid, etc. |
33 |
|
34 |
|
35 |
-- |
36 |
|
37 |
Martin Schlemmer |
38 |
Gentoo Linux Developer, Desktop/System Team Developer |
39 |
Cape Town, South Africa |