Operating System - Linux
1830234 Members
2118 Online
109999 Solutions
New Discussion

Re: Custom shutdown script on Redhat 7.2

 
SOLVED
Go to solution
Bernie Vande Griend
Respected Contributor

Custom shutdown script on Redhat 7.2

This is a strange one and seems like it shouldn't be this hard.
We are trying to put a script in place to shutdown Apache and Informix on reboot, powerdowns, etc. From what I can tell all I need is a K??informix script in rc6.d, rc0.d, rc1.d linked to /etc/rc.d/init.d/informix. We put some code in place to tell that the script is not even being called. The same script on start up works fine. Is there a trick to getting a shutdown script to be initiated?
Ye who thinks he has a lot to say, probably shouldn't.
3 REPLIES 3
Craig Kelley
Valued Contributor

Re: Custom shutdown script on Redhat 7.2

That should work just fine... Can you call '/etc/init.d/informix stop' manually and have it work properly?
Solution

Re: Custom shutdown script on Redhat 7.2

Hi :-)

I searched for the same a few hours !
Linux stores whether a /etc/init.d/xxxx was already started.
If not the Kxxx script wouldn't never be called.
Have a look to the other scripts in init.d !
Use touch /var/lock/subsys/informix in your start part !


Bernie Vande Griend
Respected Contributor

Re: Custom shutdown script on Redhat 7.2

Thanks Stefan. You hit it on the head. I had looked at the other set up scripts but missed the importance of those /var/lock/subsys
files. Works like a charm now.
Ye who thinks he has a lot to say, probably shouldn't.