Startup script failing at bootup, works when logged on
I am running RHEL3 update 6, and am attempting to create a shell script to start a process on this box at startup. I am booting to runlevel 3, have linked the scripts and all looks as though it runs but the service never starts. If I run this exact same script logged on as root it fires up just fine
#!/bin/sh
FOCUS_HOME="/opt/ibi/srv53/wfs/bin"
FOCUS_USER="focusadmin"
case "$1" in
start)
echo -n "Starting FOCUS: "
cd $FOCUS_HOME
su - $FOCUS_USER -c "nohup $FOCUS_HOME/edastart > $FOCUS_HOME/edastart.out &" #this is on one line with the above line
echo "OK, FOCUS is started"
;;
stop)
echo -n "Stopping FOCUS: "
cd $FOCUS_HOME
su - $FOCUS_USER -c "$FOCUS_HOME/edastart -stop"
echo "OK, FOCUS is stopped"
;;
reload|restart)
$0 stop
$0 start
;;
*)
echo "Usage: $0 start|stop|restart|reload"
exit 1
esac
exit 0
I am running it with the S99 prefix to guarantee that it is the absolute last script that runs. As you can see the output is redirected to a file named edastart.out in the $FOCUS_HOME directory, this file is overwritten with nothing in it, it remains at a 0 byte count. When started after login this file has text and can be displayed using cat........is there something silly that I am missing?
|