Operating System - Linux
1753852 Members
8425 Online
108807 Solutions
New Discussion юеВ

Re: Redhat chkconfig script: does the 'stop' ever run?

 
SOLVED
Go to solution
Heironimus
Honored Contributor
Solution

Re: Redhat chkconfig script: does the 'stop' ever run?

It won't run the stop scripts unless /var/lock/subsys/leonardo exists.
LBertoglio
Advisor

Re: Redhat chkconfig script: does the 'stop' ever run?

Great !! That's it!
Could you please tell me how the "/var/lock/subsys" directory works?
Do have I to create that "leonardo" file (now disappeared) during the "start" part of the script?
Many thanks !!
Leonardo.
Heironimus
Honored Contributor

Re: Redhat chkconfig script: does the 'stop' ever run?

Just add a "touch /var/lock/subsys/scriptname" to your start. Add "rm -f /var/lock/subsys/..." to your stop.

For some reason Red Hat decided to have their rc script only run a stop if /var/lock/subsys/scriptname or /var/lock/subsys/scriptname.init exists. That breaks compatibility with generic SysV-style scripts, but the truth is that most processes are safe to just kill. Most of the ones that aren't are things that people prefer to manually stop before a planned reboot anyway.