Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RedHat Shutdown

Status
Not open for further replies.

bitwise

Programmer
Mar 15, 2001
269
US
Where is the best place in Redhat 9 to place user defined shutdown commands? There is some stuff I want to do when the computer is shutdown...nothing to complicated just some logging. Where is the best place to put these commands?

Thanks,
-bitwise
 
Probably /usr/local/...

I usually define /user/... for local app stuff.
 
I understand I can put my scripts anywhere, but from what "shutdown" file in /etc/rc.d should I call them from?

-bitwise
 
Does not matter as each rc.d directory has a link to a directory (do not recall name) of all the scripts.

 
additionally if you want to do different things depending on single/multi user etc, you will have to break the link and put the actual file with your specific mods.
 
The scripts are typically located in /etc/init.d. Look at one for an example. You can make your scripts "chkconfig-compatible", or you can manually symlink them into the runlevel directories.

I wouldn't put copies of the actual scripts into the rcX.d directories; it'll just make management harder. Just have one copy of the script and link it to the appropriate runlevels.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top