LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Trobule figuring out why a script won't run at system startup (https://www.linuxquestions.org/questions/linux-general-1/trobule-figuring-out-why-a-script-wont-run-at-system-startup-4175527988/)

laredotornado 12-11-2014 11:03 AM

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?

pan64 12-11-2014 11:51 AM

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)

laredotornado 12-11-2014 12:09 PM

Yup that's it! (Can't figure out how to mark these things as solved).

pan64 12-11-2014 12:22 PM

Glad to help you

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


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