LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices

Reply
 
Search this Thread
Old 10-19-2005, 08:08 AM   #1
cmowl
LQ Newbie
 
Registered: Oct 2005
Location: Cincinnati OH
Distribution: RedHat
Posts: 4

Rep: Reputation: 0
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?
 
Old 10-20-2005, 10:22 PM   #2
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora, Lubuntu, FreeBSD
Posts: 3,930
Blog Entries: 5

Rep: Reputation: Disabled
Did you remember to turn it on in runlevel 3?

Code:
chkconfig --list | grep script_name_here
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
what shell script runs only at bootup/startup pwhitey86 Mandriva 2 12-22-2004 10:13 PM
Bootup failing at partition check -help! MarkieC Linux - Newbie 4 09-21-2004 04:08 PM
*sigh* UT2003 STartup failing under MDK 9.1 WayneDV Linux - Games 2 10-22-2003 06:52 AM
Sound works when logged in as GUI root bmike1 Linux - Hardware 11 08-19-2003 09:32 PM
mozilla works fine when logged in as a user but crashes when logged in as root jimi Linux - General 6 04-02-2003 08:34 PM


All times are GMT -5. The time now is 06:52 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration