I need help with Script running as a daemon !!!

Brooks Davis brooks at freebsd.org
Tue Feb 6 02:30:48 UTC 2007


[Please don't top-post.  It's considered rude on FreeBSD mailing lists.]

On Mon, Feb 05, 2007 at 07:10:28PM -0500, Cwalinski, Zygmunt wrote:
> Dave, 
> Thanks for your email. I have set execute bit and change the script to:
> 
> name="runtest"
> pidfile="/var/run/${name}.pid"
> rcvar=`set_rcvar`
> start_cmd=runtest_start
> command="/etc/runtest"
> command_interpreter=while
> load_rc_config $name
> runtest_enable=${runtest_enable-:NO}
> 
> runtest_start() {
>   $command &
>   echo $! > ${pidfile}
> }
> 
> I get no error when I start this script but still when I am trying to
> stop the daemon I am getting the following error:
> runtest not running? (check /var/run/runtest.pid).
> 
> (pidfile contains a correct process ID)

The value of command_interpreter is bogus.  From your previous
post, it should probably be /bin/sh.  That shouldn't be fatal in an of
it self though.  What does "ps auxww | grep `cat /var/run/runtest.pid`"
say?

Also, what version of FreeBSD are you running?

-- Brooks
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-rc/attachments/20070206/813dee43/attachment.pgp


More information about the freebsd-rc mailing list