Adding a new serivce to RedHat

Moonark

Senior member
Oct 9, 1999
387
0
0
Does anyone know how to add a new service to Linux. I have a script file created and I placed it in the directory /etc/rc.d/init.d/ with all the other scripts for services, but I cannot seem to get it to show up in the Service Configuration area. Does anyone know how? :confused:
 

Agamar

Golden Member
Oct 9, 1999
1,334
0
0
I had that problem with one or two services. What I did was went into /etc/rc.d/rc.X (whatever runlevel you want the service to run), and made a symlink to the executable with the proper prefixes for startup and shutdown. Look at the other files in the runlevel to see what I am talking about. And try to use a unique number in the prefix (and a number that is closest to the last thing that loads.)
 

manly

Lifer
Jan 25, 2000
13,201
3,986
136
Not sure about any service manager GUI, but try:

man init.d

At least SuSE Linux has that useful man page (not sure about other *nixes). I think chkconfig is somewhat of a SysV standard.
 

Buddha Bart

Diamond Member
Oct 11, 1999
3,064
0
0
use "chkconfig"

for instance "/sbin/chkconfig --list" will show all your service scripts (the ones in /etc/initi.d/) and what runlevel's they're set to go at (it does the symlinking for you).

if you want to have your script run at runlevel 2, 3, 4, and 5 it goes somethilng like "/sbin/chkconfig --add 2345 scriptname"

bart
 

Armitage

Banned
Feb 23, 2001
8,086
0
0
Originally posted by: Buddha Bart
use "chkconfig"

for instance "/sbin/chkconfig --list" will show all your service scripts (the ones in /etc/initi.d/) and what runlevel's they're set to go at (it does the symlinking for you).

if you want to have your script run at runlevel 2, 3, 4, and 5 it goes somethilng like "/sbin/chkconfig --add 2345 scriptname"

bart

chkconfig is great. I almost never muck around in the init directories anymore!