Scripts under rc0.d and rc6.d do not seem to run during shutdown.reboot
I am using RedHat 9 and have problems running scripts that should run during shutdown/reboot.
I placed a script under /etc/init.d/ ('my_script') and made a symbolic link (K40my_script)to it in /etc/rc0.d/ (for shutdown) and /etc/rc6.d/ (for rebooting).
However, when I shutdown/reboot I do not see (during shutdown/reboot on the screen within the list of scripts being run) that my scripts run.
During startup (boot), I do see (on the screen within the list of scripts running) that the script (symbolic link, 'S99my_script' under /etc/rc5.d/) runs.
Does anyone have an idea why my script does not run during shutdown/reboot although it exists as a symbolic link under rc0.d and rc6.d?
When you put a link in rcX.d, the first letter tells the system to either start (S) or kill (K) the process. If you have K for kill, then I'm not sure you would see anything happening.
Did you want your script to start or kill when re-booting or shutting-down?
Shutting down/re-boot and rc0.d / rc6.d
Thank You for your reply.
The scripts aim to stop processes that are running. As such I think they should be 'K'. I also thought that all scripts in rc0.d and rc6.d which are shutdown and re-boot levels should be 'K'. Do you think they may need to be 'S'? What is the meaning of an 'S' script during shutdown (isn't shutdown when you want to kill (and not start) all processes?)
I thought that maybe the scripts do actually run (and I just do not 'see' them run on the console). But then:
a. I get a 'FAIL' on the screen when the system tries to shut down PPP0 (during shutdown) and that proves to me that my script is not running (it is a script that stops my internet cable connection). Had my script run, I expect PPP0 to be shut without failing.
b. If K20mysql exists under rc6.d and during re-boot I see on the screen that the mysql is running (stopping), why would I not see K40my_script run during re-boot (it is also under rc6.d)?
the same problem!!!
I have de same problem....and it is growing 'cause any scripts i add to the rc's does not run....like oracle, tuxedo, mqseries, etc.
If you know any solution...please let me know.
i'm running red hat enterprise linux and fedora.....
The reason RedHat does not kick off your K* rc shutdown scripts is because RedHat checks for a lock file for your script in /var/lock/subsys/<scriptname>
To fix this, simply add a line to your 'start' section, something like this:
Here is the actual snippet of the code from /etc/rc.d/rc that does this:
|All times are GMT -5. The time now is 10:30 AM.|