LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Enterprise (https://www.linuxquestions.org/questions/linux-enterprise-47/)
-   -   Startup script failing at bootup, works when logged on (https://www.linuxquestions.org/questions/linux-enterprise-47/startup-script-failing-at-bootup-works-when-logged-on-374636/)

cmowl 10-19-2005 08:08 AM

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?

anomie 10-20-2005 10:22 PM

Did you remember to turn it on in runlevel 3?

Code:

chkconfig --list | grep script_name_here


All times are GMT -5. The time now is 01:28 PM.