LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Adding Service RedHat 9 (https://www.linuxquestions.org/questions/linux-newbie-8/adding-service-redhat-9-a-85914/)

green123 08-26-2003 12:40 PM

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

yowwww 08-26-2003 12:44 PM

type:
redhat-config-services

pick which one you want, then save it.

green123 08-26-2003 12:58 PM

How do I add a service to this list?

Medievalist 08-26-2003 01:15 PM

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.

Skyline 08-26-2003 01:27 PM

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.


All times are GMT -5. The time now is 09:28 PM.