On Tue, Aug 29, 2000 at 11:52:34PM -0500, Manoj Srivastava wrote: > Hi, A belated Hi! in return....
> What do people feel about periodic postings of this list to > this mailing list, say, once a month? This used to be done by Joey Hess on a weekly basis. But it's hard work. > #60979: What /etc/init.d/xxx restart does? > status: restart stops and starts the program, perhaps we need a > start-rc.d script We now are waiting for code. > Action: Nothing, until the code is written. > This should be downgraded to a proposal, pending code. > > #20373: [PROPOSAL] shouldn't start init scripts in wrong runlevel > Status: this is the same problem as addressed in #60979. We need > code for start-rc.d > Action: Nothing, until the code is written. I've written and posted skeleton code. It should not be much work to flesh it out. However, it will need rewriting for the file-rc package as well. Just checking my archives to find the code.... Ah, found it (and small patch applied): ----- Subject: Re: start daemons according to current runlevel upon upgrade To: [EMAIL PROTECTED] Date: Wed, 6 Oct 1999 23:18:03 +0100 (BST) Cc: debian-devel@lists.debian.org > I have created two scripts named start-rc.d. One for runlevel links and > one for file-rc. I think, they should be included in the corresponding > packages which contain the update-rc.d skript (dpkg and file-rc). Firstly, see bug#20373 where this is discussed. A policy change would be worthwhile. I would recommend start-stop-service as a name, parallelling start-stop-daemon and you need the following logic, not including error checking (and you beat me to it by just a couple of days); remember that you need to check /etc/rcS.d as well! <copy startup() from /etc/init.d/rc> <baulk if #args!=2> PATH=/usr/sbin:/sbin service=$1 op=$2 runlevel=`runlevel | cut -c3` <baulk if ! -f /etc/init.d/$service> case "$2" in start|restart|reload|force-reload) start=/etc/rc$runlevel.d/S[0-9][0-9]$service stop=/etc/rc$runlevel.d/K[0-9][0-9]$service rcS_start=/etc/rcS.d/S[0-9][0-9]$service # Check whether the daemon should be started if [ -f $start ]; then startup $i $2 elseif [ -f $rcS_start ] && [ ! -f $stop ]; then startup $i $2 fi ;; stop) [ -f /etc/init.d/$service ] && /etc/init.d/$service stop ;; *) <give error message> ;; esac Note that this assumes that /etc/init.d/$service won't fall over if you stop a stopped daemon or start a started one; this should probably be made a policy requirement. ----- So let's do something, shall we? ;-) This script needs completing and going into the sysvinit package, and translating for the file-rc package. Shall we call it start-rc.d or start-stop-service? Julian -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Julian Gilbey, Dept of Maths, QMW, Univ. of London. [EMAIL PROTECTED] Debian GNU/Linux Developer, see http://www.debian.org/~jdg Donate free food to the world's hungry: see http://www.thehungersite.com/