Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Jan 2001 08:50:56 +0300
From:      Odhiambo Washington <wash@iconnect.co.ke>
To:        Matthew Emmerton <matt@gsicomp.on.ca>
Cc:        FBSD-Q <freebsd-questions@freebsd.org>
Subject:   Re: Starting daemons in rc.local
Message-ID:  <20010115085056.B9478@poeza.iconnect.co.ke>
In-Reply-To: <00bc01c07e43$8e0429c0$1200a8c0@gsicomp.on.ca>;  from "Matthew Emmerton" on Sun, Jan 14, 2001 at 11:03:35AM -0500
References:  <20010113220443.A528@poeza.iconnect.co.ke> <005e01c07d97$b7fdef60$1200a8c0@gsicomp.on.ca> <20010114104750.A4581@poeza.iconnect.co.ke> <00bc01c07e43$8e0429c0$1200a8c0@gsicomp.on.ca>

next in thread | previous in thread | raw e-mail | index | archive | help
* Matthew Emmerton <matt@gsicomp.on.ca> [20010114 19:35]: writing on the subject 'Re: Starting daemons in rc.local'
Matthew> > Hi Matt,
Matthew> > Thank you so much for this. I agree I will have to move the startup
Matthew> > scripts to rc.d/ but what I needed is the coding for these scripts in
Matthew> > the new format required by 4.2-STABLE, that the scripts should recognize
Matthew> > a SIGHUP (I saw such a warning when I first started 4.2-S).
Matthew> > Being the 'learner' that I am, I needed assistance to that end.
Matthew> 
Matthew> Perhaps I'm confused or just don't know, but the man page docs for rc(8) for
Matthew> 5.0-CURRENT don't outline anything different than 4.2-RELEASE.  I don't
Matthew> track STABLE, so I'm unaware of any new conventions that are required by
Matthew> startup scripts in rc.d/
Matthew> 
Matthew> In case you still need it, a simple rc.d/ script using start/stop labels
Matthew> would be like this (from the 5.0-CURRENT rc(8) man page).  Note that you'll
Matthew> have to check to ensure that radiusd and filterd actually create pid files
Matthew> in /var/run, if not you'll have to work some other magic to stop those
Matthew> processes.
Matthew> 
Matthew> If you still have problems, please send me the output of man rc(8) on 4.2-S
Matthew> and I'll figure out what needs to be changed for you.
Matthew> 
Matthew> #!/bin/sh
Matthew> #
Matthew> # Startup/shutdown script for radius and choicenet
Matthew> 
Matthew> case "$1" in
Matthew> start)
Matthew>     echo "radius"
Matthew>     if [ -f /sbin/radiusd ]; then
Matthew>         /sbin/radiusd -d /etc/raddb -a /var/adm/radacct && echo -n "radius"
Matthew>     fi
Matthew> 
Matthew>     echo "choicenet"
Matthew>     if [ -f /etc/choicenet/filterd ]; then
Matthew>         /etc/choicenet/filterd && echo -n "choicenet"
Matthew>     fi
Matthew>     ;;
Matthew> 
Matthew> stop)
Matthew>     kill `cat /var/run/radiusd.pid` && echo -n "radius"
Matthew>     kill `cat /var/run/filterd.pid` && echo -n "choicenet"
Matthew>     ;;
Matthew> 
Matthew> *)
Matthew>     echo "unknown option: $1 - should be 'start' or 'stop' >&2
Matthew>     ;;
Matthew> esac
Matthew> 
Matthew> --
Matthew> Matt Emmerton
Matthew> 

Hi Matthew,

Thank you once again for reverting to me. I'm writing to inform you that
I also tried to adapt the example script in rc(8) man page for
4.2-STABLE but I realized that even though the processes started, they
were not creating the process pid in /var/run. So really i am now into
looking at a way of having the magic pid created....

Does anyone know how to achieve this for any process???

-Wash

--
Odhiambo Washington  Inter-Connect Ltd.,
wash@iconnect.co.ke  5th Flr Furaha Plaza
Tel: 254 11 222604   Nkrumah Rd.,
Fax: 254 11 222636   PO Box 83613 MOMBASA, KE.

Entropy isn't what it used to be. 
(contributed by Chris Johnston) 


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010115085056.B9478>