- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: start service when system startup
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2002 02:50 AM
12-17-2002 02:50 AM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2002 03:16 AM
12-17-2002 03:16 AM
Re: start service when system startup
Edit /etc/rc.d/rc.local file and put your commands there . reboot the server now your commands will run automatically.
regards,
U.SivaKumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2002 03:30 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2002 03:35 AM
12-17-2002 03:35 AM
Re: start service when system startup
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2002 05:05 PM
12-17-2002 05:05 PM
Re: start service when system startup
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2002 08:46 PM
12-17-2002 08:46 PM
Re: start service when system startup
As it stands, here's a brief over-view.
When *nix machine boots up, it uses the process 'init' to say what should be done and in what order. If you have a look through the configuration file for init (/etc/inittab), there will be a single line starting with 'si', and then multiple lines that start with 'l' followed by the numbers 0 through 6. These are the different run-levels of a machine.
Quick explination of what the 7 different widely used run-levels:
0 : Designed to 'halt' the machine
1 : usually a Single User mode
2 : A form of Multi-User. Use differes depending on OS and Distribution.
3 : Another multi-user. See above.
4 : Not usually used at all.
5 : Most linux machines use this for X, otherwise not usually used.
6 : Shutdown the machine and restart it. A 'reboot' if you will.
Depending on what Unix/Linux you're using change the way things get started and stopped when changing run levels. For the sake of this thread, I'll keep it short.
Simple put, these levels of 'init' call a program (or shell script) checks a given directory structure (on most modern Linux boxes, it's /etc/rc.d/rc
In RedHat, '/etc/rc.d/rc' is the shell script that does most of the work.
When booting up to Run Level 3 (standard Multi-User), it walks through the S and K files in /etc/rc.d/rc3.d/ and starts any that begin with an 'S', with the single argument 'start'. The last file (sorted alphabetically) in this structure is usually 'S99local'.
When shutting a machine down, either /etc/rc.d/rc0.d or /etc/rc.d/rc6.d gets parsed, and all files starting with a 'K' get executed, with the single argument of 'stop'.
Now. If you want to put your own scripts in this structure to start a service when the system starts, you can. Just call it 'S
The other option is to use /etc/rc.d/rc.local. This gets called when the 'S99local' routine gets executed in the rc
I hope this helps clarify things a little for you.
(NOTE: This is based on the behaviour of RH Linux. Other distributions might behave slightly differently, and also some Unicies behave slightly differently.)