Hi,
I've created a custom script /usr/local/etc/rc.d/LaBrea.sh in order to enable LaBrea at boot. I have made it executable.
The script fails during boot with this error -
If you can could you please help me sort this out.
Best,
dave
I've created a custom script /usr/local/etc/rc.d/LaBrea.sh in order to enable LaBrea at boot. I have made it executable.
Code:
#!/bin/sh
# $FreeBSD$
#
# PROVIDE: LaBrea
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following line to /etc/rc.conf[.local] to enable LaBrea
#
# LaBrea_enable (bool): Set to "NO" by default.
# Set it to "YES" to enable LaBrea.
# LaBrea_user (str): User account to run with.
# LaBrea_flags (str): Custom flags for LaBrea.
. /etc/rc.subr
name=LaBrea
rcvar=`set_rcvar`
command="/usr/local/bin/LaBrea -z -s -o -b -p 2000000 -i nfe0"
pidfile="/var/run/${name}.pid"
HOME=$(/usr/sbin/pw usershow -7 -n "${LaBrea_user}" | /usr/bin/cut -d: -f6)
start_cmd="${name}_start"
LaBrea_start()
{
local pid
pid=$(check_pidfile $pidfile $command)
if [ -n "${pid}" ]; then
echo "${name} already running? (pid=${pid})."
return 1
fi
echo -n "Starting ${name}"
/usr/bin/touch ${pidfile}
/usr/sbin/chown ${LaBrea_user} ${pidfile}
/usr/sbin/daemon -f -p ${pidfile} -u ${LaBrea_user} ${command}
${LaBrea_flags}
echo '.'
}
load_rc_config $name
: ${LaBrea_enable="YES"}
: ${LaBrea_user="david"}
run_rc_command "$1"
The script fails during boot with this error -
Code:
Starting LaBrea
usage: chown [-fhvx] [-R [-H | -L | -P]] owner[:group] file ...
chown [-fhvx] [-R [-H | -L | -P]] :group file ...
daemon: illegal option -- z
usage: daemon [-cf] [-p pidfile] [-u user] command arguments ...
If you can could you please help me sort this out.
Best,
dave