Question about rc-scripts

Derek Ragona derek at computinginnovations.com
Mon Oct 8 16:36:43 PDT 2007


At 05:45 PM 10/8/2007, Stephen Allen wrote:
>Under normal circumstance, should the /etc/rc.subr functions handle the
>creation of the pid at service start?
>
>The basic vendor-provided script (which I've had to adapt somewhat to
>suit this installation) runs "echo $! > ${dbgw_pidfile}" as the last
>line of the script.  When you do a 'status' command though, it blanks
>out the contents of the pid.  That echo line isn't present in any of the
>standard scripts - hence my initial question.
>
>Apart from variable assignments, the script defines 'start_cmd' (which I
>assume is used as the start command by rc.subr).  Strange that I
>couldn't find any reference to start_cmd in /etc/rc.subr though.
>
>So, my question is, why isn't the pidfile being automagically created?
>
>Many thanks,
>Steve

Not all scripts create a pid file is the simple answer.

Your script should create the pid file on start, remove it on stop, and 
simply cat that file on a status.  If you want help with your script, post 
it, and I'm sure one of us will give you a hand.

         -Derek

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
MailScanner thanks transtec Computers for their support.



More information about the freebsd-questions mailing list