why my daemon did not start

Andrew L. Gould algould at datawok.com
Tue Oct 18 08:44:13 PDT 2005


On Tue, 18 Oct 2005 23:34:15 +0800
"Foo JH" <jhfoo at nexlabs.com> wrote:

> Hi all, I'm trying to write a simple RC script to run my little Perl
> script as a daemon. The script is as follows:
> 
> #!/bin/sh
> 
> portal_enable=${portal_enable-"NO"}
> portal_flags=${portal_flags-""}
> portal_pidfile="/var/run/portald.pid"
> 
> . /etc/rc.subr
> 
> name="portald"
> rcvar=`set_rcvar`
> command="/home/admin/perfectportal/portald.pl &"
> 
> load_rc_config $name
> pidfile="${portal_pidfile}"
> start_cmd="echo \"Starting ${name}.\"; /usr/bin/nice -5 ${command}
> ${portal_flags} ${command_args}" stop_cmd="kill `cat /var/run/
> portald.pid`" run_rc_command "$1"
> 
> If I were to run this manually via 
> /usr/local/etc/rc.d/portald.sh start
> it works. but in a reboot, it does not start.
> 
> Can anyone guide me where to find the error message, or (even better)
> what may be the problem? Thanks.

I haven't studied up on the rc.subr stuff; but I've noticed that many
of the scripts that use it require that an enable line be put in /etc/
rc.conf.  Have you tried adding the following line to /etc/rc.conf:

portal_enable="YES"

Best of luck,

Andrew Gould


More information about the freebsd-questions mailing list