Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: respawning script
PostPosted: Sun Sep 23, 2012 3:40 pm 
Offline
Newbie

Joined: Sun Sep 23, 2012 2:51 pm
Posts: 2
Hello,

I am trying to migrate a respawn mechanism in CentOS5 to CentOS6. In CentOS5, I had a 'respawn' event in /etc/inittab pointing directly to my script which launched a java process (if script died (caused by death of java process), script got autorestarted). In CentOS6, I understand that I must do this differently. Seems like I have to use Upstart.

After reading some posts on the web, I created the following file: /etc/init/MIL.conf.

Inside of this file I have:


Code:
#MIL starter

start on stopped rc RUNLEVEL=[2345]
stop on runlevel [!2345]

respawn

cd /home/foo/MIL
exec java -jar MIL1.6.jar -port 10005



However when I try to launch this script using:
# initctl start MIL

I get...

initctl: Unknown job: MIL


Any advice on the specific problem? More generally?


Top
   
 Post subject: Re: respawning script
PostPosted: Sun Sep 23, 2012 8:32 pm 
Offline
Senior Member
User avatar

Joined: Tue Apr 13, 2004 6:54 pm
Posts: 833
Don't you need "script" and "end script" around the commands you want to run?

Code:
script

cd /home/foo/MIL
exec java -jar MIL1.6.jar -port 10005

end script

_________________
Rgds
Stephen
(Linux user since kernel version 0.11)


Top
   
 Post subject: Re: respawning script
PostPosted: Sun Sep 23, 2012 10:19 pm 
Offline
Newbie

Joined: Sun Sep 23, 2012 2:51 pm
Posts: 2
sweh,

Yes, that did it!

Thank you very much.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group