Попробуйте так:
/usr/local/etc/rc.d/nodhcp.sh#!/bin/sh
# PROVIDE: nodhcp
# REQUIRE: LOGIN mysql
. /etc/rc.subr
name="nodhcp"
rcvar=`set_rcvar`
load_rc_config $name
: ${nodhcp_enable="YES"}
: ${nodeny_dir="/usr/local/nodeny"}
start_cmd="${name}_start"
stop_cmd="${name}_stop"
restart_cmd="${name}_restart"
pidfile="/var/run/${name}.pid"
nodhcp_start()
{
cd $nodeny_dir
pid_old=`cat $pidfile 2>/dev/null`
echo -n "Starting $name..."
sh gonomake.sh ${name} &
sleep 2
pid_new=`cat $pidfile 2>/dev/null`
if [ $pid_old ] && [ $pid_old = $pid_new ];
then
echo "No. Already running"
else
echo "OK"
fi
}
nodhcp_stop()
{
cd $nodeny_dir
echo -n "Stopping $name..."
pid=`cat $pidfile 2>/dev/null`
if [ $pid ];
then
kill -TERM $pid;
echo -n "Waiting pid $pid"
while true
do
echo -n "..."
if [ ! -f "$pidfile" ]; then break; fi
sleep 1
done
echo "OK"
else
echo "$name is not running (no $pidfile)"
fi
}
nodhcp_restart()
{
nodhcp_stop
nodhcp_start
}
run_rc_command "$1"
/usr/local/nodeny/gonomake.sh#!/bin/sh
prg="perl nomake.pl $1"
while true
do
${prg}
rez=$?
case $rez in
0 ) sleep 2 ;;
* ) break ;;
esac
done
exit $rez
/usr/local/nodeny/nodhcp.txt переименуйте в /usr/local/nodeny/nodhcp
В rc.conf добавить nodhcp_enable="YES"
На 10-й ветке работает...