oh wow... LOL. It's getting better and better...:e
samba_enabled="YES"
red5_enable="YES"
~/red5.sh but I need it to run as a service when I boot. I am inclined to think it may have something to do with the fact that the media server is jailed but only the host's dmesg is available and it does not mention red5 at all.#!/bin/sh
export RED5_HOME=/home/red5/
export JAVA_HOME=/usr/local/diablo-jdk1.6.0
red5_user="${red5_user:-"red5"}"
red5_pidfile="${red5_pidfile-"/var/run/red5.pid"}"
red5_chdir=$RED5_HOME
. "/etc/rc.subr"
name="red5"
rcvar=`set_rcvar`
command="$RED5_HOME/${name}.sh"
command_args=" > /dev/null 2>&1&"
pidfile="${red5_pidfile}"
start_postcmd=start_postcmd
stop_cmd="echo \"Stopping ${name}.\"; ${RED5_HOME}/red5-shutdown.sh"
start_postcmd() {
local seconds
for seconds in 1 2 3; do
sleep 1
done
ps -U red5 -a | grep 'red5.root' | cut -d ' ' -f1 | tr -d '\n' > ${pidfile}
}
load_rc_config "${name}"
run_rc_command "$1"
Seriously? Try "sleep 3" instead of this.Code:for seconds in 1 2 3; do sleep 1 done
Code:ps -U red5 -a | grep 'red5.root' | cut -d ' ' -f1 | tr -d '\n' > ${pidfile}
pgrep -U ${red5_user} -f red5.root > ${pidfile}
# sh -x /usr/local/etc/rc.d/red5 startSirDice said:One way to trace it is to start it with the -x option:
# sh -x /usr/local/etc/rc.d/red5 start
eval: cannot create /var/run/red5.pid: Permission denied
# sh -x /usr/local/etc/rc.d/red5 start
phoenix said:Oh, and for those wanting to use service(1), it's just a shell script, so it can be "backported" to any FreeBSD release that uses RCng. IOW, it should work on any release since 5.2. I've tested it no 6.3 and it works quite nicely.