Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Red Hat This forum is for the discussion of Red Hat Linux.


  Search this Thread
Old 08-19-2004, 02:49 PM   #1
LQ Newbie
Registered: Aug 2004
Posts: 1

Rep: Reputation: 0
How to setup shells to run when the server boots/shuts down?


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!!



Last edited by Colmenares; 08-19-2004 at 02:57 PM.
Old 08-19-2004, 04:03 PM   #2
Registered: Oct 2003
Posts: 568

Rep: Reputation: 30
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!
Old 08-19-2004, 04:04 PM   #3
Registered: Feb 2004
Location: Utah, USA
Distribution: Debian
Posts: 230

Rep: Reputation: 31
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.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Making shells run at startup? Tuxluver Fedora 3 02-19-2005 02:57 PM
Slackware 10.0 Boots, But Setup cant detect CDROM Terei Slackware - Installation 8 02-02-2005 02:13 PM
apache server shuts down for unknown reason jordanthompson Linux - Software 3 01-18-2005 09:15 PM
etc/profile.local setup for different shells breenbaron Linux - General 0 03-31-2004 02:45 AM
program to run whne system shuts down jayakrishnan Linux - General 1 10-15-2003 06:39 AM > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 02:55 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration