LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-26-2003, 01:40 PM   #1
green123
LQ Newbie
 
Registered: Aug 2003
Posts: 3

Rep: Reputation: 0
Question Adding Service RedHat 9


How do I add setup linux to automatically start running a program when the OS boots. It is a server app that I want running all the time in the background?

Thanks.

Green123
 
Old 08-26-2003, 01:44 PM   #2
yowwww
Member
 
Registered: Apr 2003
Location: Ontario, Canada
Distribution: Arch Linux
Posts: 533

Rep: Reputation: 30
type:
redhat-config-services

pick which one you want, then save it.
 
Old 08-26-2003, 01:58 PM   #3
green123
LQ Newbie
 
Registered: Aug 2003
Posts: 3

Original Poster
Rep: Reputation: 0
How do I add a service to this list?
 
Old 08-26-2003, 02:15 PM   #4
Medievalist
Member
 
Registered: Aug 2003
Distribution: Dead Rat
Posts: 178

Rep: Reputation: 38
The list is generated by scanning the contents of the directory /etc/rc.d/init.d. There is a file for each service. The files contain scripts (typically a bash script) that support the commands start and stop (minimum) and often also restart, reload and status. Take a look at some of the files in this directory to see what I mean... look at /etc/rc.d/init.d/named, for example (that particular one will only be available if you have the DNS nameserver software loaded).

This is a powerful, flexible system that can be manipulated directly from the command line or easily represented in GUI dialogs.

If you run your system in "pure" graphic mode you are in runlevel 5. If you run your system in the faster mode (text logins, then type "startx" to get into a GUI) you are in runlevel 3. There are other runlevels that serve other purposes, and a bit of documentation can be found in the comments of the file /etc/inittab. Don't bugger up *that* file, incidentally, or your system will probably fail to boot.

In Red Hat, the tool chkconfig updates and queries runlevel information for system services. This tool wants to see certain information in the comments at the top of each script in /etc/rc.d/init.d; if you look at some of the scripts already there you should see what I mean; alternatively check the doco for the chkconfig tool (do a man chkconfig from a terminal prompt) which explains what these comments mean and what you will have to do to get your new service known by chkconfig and friends.
 
Old 08-26-2003, 02:27 PM   #5
Skyline
Senior Member
 
Registered: Jun 2003
Distribution: Debian/other
Posts: 2,104

Rep: Reputation: 45
Create a symlink from one of the services in

/etc/rc.d/init.d

and put the symlink in

/etc/rc.d/rc5.d

(if your running in graphical mode - each of the rcx.d directories contain the symlinks for that run level - so if its a different run level use the relevant directory)

make sure you rename it to

Sxx

capital S

were xx

is the order number of when you want the service to start
- some services need to start before or after others - be careful you put it in the right start order - be careful though.

Last edited by Skyline; 08-26-2003 at 03:03 PM.
 
  


Reply


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
Adding mysqld as a service in GUI Redhat 3 blue80_in Linux - Software 2 11-29-2004 10:32 PM
Adding new service to a runlevel. atlesn Linux - Software 5 06-06-2004 05:56 PM
Adding new xinetd service Aldric Linux - Networking 1 06-03-2004 12:40 PM
adding a service neverender Mandriva 4 01-14-2004 07:25 AM
adding a program as a service neverender Linux - Software 2 01-14-2004 06:29 AM


All times are GMT -5. The time now is 03:13 AM.

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