How to setup shells to run when the server boots/shuts down?
Environment:
RH AS 2.1. Intel Hardware I need to include a script to bring up all of our databases after the server enters multi-user mode, and shut them down before leaving muti-user mode. I know that I need to place the files in the /etc/rc directory structure but have not found any Linux documentation to guide me. I have been reading the man rc entry for HP-UX but I'm not sure how valid it will be - and I can't go around rebooting the server! If anybody can point me in the right direction as to where to find good documentation, I would appreciate it. I'll also take examples!! ;) Thanks, Carlos |
If you want something to run as you are entering multiuser mode, you simply have to add the commands, or a reference to the script into /etc/rc.d/rc.3
If you want something to run, or you want to explicitly kill something running as you are rebooting/shutting down, you would need to change each of those scripts as well, those can be found here: rebooting: /etc/rc.d/rc.6 shutting down: /etc/rc.d/rc.0 Needless to say, to edit these, you must be root. Good Luck! |
If you want something to run when you boot up simply add command line to your /etc/rc.d/rc.local file - it's the last file to run and it's specifically for you to use to start apps on boot.
|
All times are GMT -5. The time now is 01:11 AM. |