Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 08 Oct 2007 18:35:53 -0500
From:      Derek Ragona <derek@computinginnovations.com>
To:        Stephen Allen <sdafreebsduk@rowyerboat.com>, FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   Re: Question about rc-scripts
Message-ID:  <6.0.0.22.2.20071008183414.025a1e88@mail.computinginnovations.com>
In-Reply-To: <470AB2FC.8070006@rowyerboat.com>

index | next in thread | previous in thread | raw e-mail

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.



home | help

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