respawning script
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:
#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?
2 Replies
script
cd /home/foo/MIL
exec java -jar MIL1.6.jar -port 10005
end script
Yes, that did it!
Thank you very much.