LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-11-2014, 11:03 AM   #1
laredotornado
Member
 
Registered: Apr 2011
Posts: 71

Rep: Reputation: 0
Trobule figuring out why a script won't run at system startup


Hi,

Below is the Linux flavor I’m using

Code:
uname -a
Linux mydomain.org 3.82.95-13.77.amzn1.x86_64 #1 SMP Wed Dec 3 21:29:43 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
I’m trying to get a script to run when I reboot my Linux instance (sudo reboot now). I have created this script in /etc/init.d/start_tomcat with +x permissions ..

Code:
#!/bin/sh

sh /home/davea/install/apache-tomcat-6.0.35/bin/startup.sh
and created shortcuts to this script at /etc/rc2.d/start_tomcat, /etc/rc3.d/start_tomcat, /etc/rc4.d/start_tomcat, and /etc/rc5.d/start_tomcat . I can run the script (sudo sh /etc/init.d/start_tomcat) just fine on a command line, but when I reboot my system, the script isn’t getting run (nothing in my Tomcat logs and the server is not started). How can I figure out what is happening when Linux is attempting to run this script?
 
Old 12-11-2014, 11:51 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,685

Rep: Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274
in rcX.d there is a naming convention you need to follow. All the scripts should start with an upcase S followed by two digits, so probably you need to rename start_tomcat to S45start_tomcat (or similar)
 
Old 12-11-2014, 12:09 PM   #3
laredotornado
Member
 
Registered: Apr 2011
Posts: 71

Original Poster
Rep: Reputation: 0
Yup that's it! (Can't figure out how to mark these things as solved).
 
Old 12-11-2014, 12:22 PM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,685

Rep: Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274
Glad to help you

in the thread tools, on the top of the thread (right side).
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Upstart script not being run on system startup... ddenton Linux - General 1 11-23-2011 08:59 AM
Run script on X startup alexbrui Slackware 3 05-05-2010 01:32 PM
How to run a script at system startup? correro Linux - Newbie 4 01-20-2006 09:12 AM
'cannot stat' script in /etc/rc.d/, try to run script at startup quintan Linux - Software 1 11-21-2005 02:53 AM
Apache and MySQL servers won't run at startup! dday007 Linux - Newbie 2 02-07-2003 04:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:35 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration