Adding Services to RHEL with chkconfig

If you want your daemons to start and stop with your Redhat system as it boots chkconfig is what you were looking for.

First off you want to create a chkconfig script. You can do this by copying a simple one from /etc/init.d/

Then copy your new script to /etc/init.d/ make sure it is executable. Give the script the name of the service you want to control.

Then run the command
chkconfig –add theServiceName

To have the service start on boot run
chkconfig –level 2345 theServiceName on

You can view all services with the command
chkconfig –list
This will list at what runlevel a service will start.

to stat and stop your new services use the commands
service theServiceName start
service theServiceName stop
service theServiceName status
service theServiceName restart

Tags: , , , , ,

Leave a Reply