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