[CentOS] System V Init Script
jdmls at yahoo.com
Wed Jun 3 12:15:14 UTC 2009
From: James Bensley <jwbensley at gmail.com>
> I have pasted the code below from my "restart" clause but from what I can
> tell, it is killing the app but not restarting it, I think because the
> killing process is still in action so when it start the app again it just
> gets killed straight away. If I enter "/etc/init.d/my_app restart" the app
> is terminated but does not start again, entering "/etc/init.d/my_app start"
> immediately after fires it up straight away so there is no problem there;
You kill all "*my_app*" processes and your init script is called... "my_app_..."? ^_^
Also, it is easier to create functions for start, stop, etc...
Then restart = start; stop
Have a look at other init scripts.
More information about the CentOS