Dummy Question, put a script on startup fails

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat Dummy Question, put a script on startup fails
# 1  
Old 05-10-2012
Dummy Question, put a script on startup fails

Hi all, im pretty new to unit/redhat 6.2
I am trying to load a script upon startup of my redhat 6.2
(instance in ec2 AWS if someone cares)

I want everytime when instance starts (after stop/reboot) a script i build to launch. when i run the script ./scriptname the script runs and everything is OK.
i added the following lines to /etc/rc.local by using "sudo vi /etc/local.rc"
Code:
#!/bin/sh
/etc/init.d/softimize-init
fi

Then i saved and exited.
then i stopped the instance, started it, and it does not perform the script.
if i do /etc/rc.local when i am logged it, it will apply it good..

Does rc.local is the proper place to put the command ?
Do i need to chmod the file after modifiying ?

I also tried to put it in chkconfig, to add the script, and it added it, but still does not run it on startup.

thanks

Last edited by Scrutinizer; 05-10-2012 at 06:50 PM..
# 2  
Old 05-10-2012
/etc/rc.local is executed only once during server boot. To run your script when the application is being started, you should add it to the application's start script. How are you starting the instance?
# 3  
Old 05-10-2012
I am logged from console.aws.amazon.com EC2 dashboard..
and i start/stop instance from there.
# 4  
Old 05-10-2012
hookedatwalla, to run a script system wide at start up on a Red Hat type system use /etc/rc.d/rc.local .

/etc/rc.local is for Deb based systems.
# 5  
Old 05-11-2012
I debugged it and found that

Hi again,
i debugged my problem, meaning i cat /var/log/boot.log
and saw:
Code:
/etc/rc3.d/S20softimize-init: line 10: ec2-associate-address: command not found

meaning, i guess, that system does not know what is ec2-associate-address during the time of starting services..

Why is that ? how can i bypass it ?
after im logged in from putty, if i ec2-associate-address then the command is known and working.

Last edited by radoulov; 05-11-2012 at 07:19 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Dummy Question

Where can I get UNIX? (1 Reply)
Discussion started by: ciao303
1 Replies

2. Shell Programming and Scripting

Apache tomcat startup script not booting at startup.

I copied the script from an AskUbuntu post - #!/bin/bash ### BEGIN INIT INFO # Provides: tomcat7 # Required-Start: $network # Required-Stop: $network # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start/Stop Tomcat server ### END INIT INFO ... (14 Replies)
Discussion started by: Hijanoqu
14 Replies

3. Shell Programming and Scripting

Apache Startup Fails with PHP Error

Great tins massive! Im Manqoba from Midrand, South Africa... I have installed Apache and PHP on a solaris 9 box, using the packages below: apache-2.2.14-sol9-sparc-local php-5.2.13-sol9-sparc-local After installing the packages I edited my httpd.conf file, to load the php5 module when... (10 Replies)
Discussion started by: Macarena S.A
10 Replies

4. Solaris

how to put script in startup

Hi All, O/S: Solaris 5.10 Software installed :- Oracle 10G Weblogic 10.30 the problem i face that when the server restart for any reason SQL> exit bash-3.00# sqlplus sys/manchester as sysdba SQL*Plus: Release 10.2.0.1.0 - Production on Sun May 2 11:04:50 2010 Copyright (c)... (3 Replies)
Discussion started by: xxmasrawy
3 Replies

5. UNIX for Dummies Questions & Answers

a dummy question...needs help...

I am trying to use 'cut' to get a line from my file. But it seems that 'cut' recongnizes TAB as default. My file uses space instead. So 'cut' doesn't work. Anybody can tell me how to change the default from TAB to space ? Or how to transform a space-delimited file into tab-delimited file??... (2 Replies)
Discussion started by: kaixinsjtu
2 Replies

6. HP-UX

Auto-Port Aggregation startup fails on boot

I have a machine running HP-UX 11.23 (PARISC) and APA startup fails on boot. This is found in /etc/rc.log: Configure Auto-Port Aggregation(LAN Monitor) interfaces Output from "/sbin/rc2.d/S343hplm start": ---------------------------- get_start_dlpi_version: failed, errno is 22 ERROR: ... (1 Reply)
Discussion started by: kknigga
1 Replies

7. UNIX for Advanced & Expert Users

Put fails during FTP

Hi All, I am facing a while i use mput to the server. Actually i have data on client machine which is windows XP. The data is near to 1GB. I have zipped the data. I can ftp and connect to Server(Which has Fedora 4 running). but when i do mput *.zip it gives an error. I tried to put in a... (2 Replies)
Discussion started by: prakash.kudreka
2 Replies

8. Filesystems, Disks and Memory

A simple dummy question

Hello Everyone! changing from Microsoft to Macintosh, I connected my hard disk (nearly full) to the apple computer, which could not recognize it. I was prompt to "initialize it", unfortunately I DECIDED YES!!, but just for 1/100 of a second: now I cannot access the hard disk at all. Is still... (1 Reply)
Discussion started by: NETTO68
1 Replies

9. UNIX for Dummies Questions & Answers

question from a dummy

okay so I just started this unix class and understood all the test questions but this "normal" question threy me through a loop :confused:. The question is Why are UNIX commands noninteractive and why is their output not usually preceededby header information? This question has been driving me... (2 Replies)
Discussion started by: cinnamonbear
2 Replies

10. UNIX for Dummies Questions & Answers

Unix dummy's question

:confused: Hi, 2 questions to get some insight. Thanks (1) I would like to add a prefix (XX00) in each row of the line in my text file and save a newly generated file another name. How to go about it. (2) How to insert a blank line into each row in my file. and save the file another name.... (2 Replies)
Discussion started by: merry susana
2 Replies
Login or Register to Ask a Question