Tips Linux Explorers   All Things Linux Forum   Great Linux Links   LinuxClues.com   Hometown    



INITSCRIPT SERVICES ( chkconfig )
And how to turn them on, off, start, stop or restart


A lot of services are started at boot with the initscripts. There is a way to see what service is started in what run-level, a way to start and stop a service temporary from the commandline, and a way to make a service to run on or stay off at boot.

Let us first see what services there are and in what level they are started:

CODE
# chkconfig --list

This gives you the full list.

Now we know all the services we have 4 commands that are useful ( let us take "numlock" as an example ):

CODE
# service numlock stop
# service numlock start
# service numlock restart
# service numlock status

The first command will stop a service temporary until the next time you reboot. The second one will start it, also until the next reboot. The third command speaks for itself.

Now you want to stop a service, but you also want to prevent it from being started the next time you boot:

CODE
# service numlock stop
# chkconfig numlock off

Or the other way around, you want to start a service that is not running and make sure it will be up running next time you reboot:

CODE
# service numlock start
# chkconfig numlock on

NOTE: The first command is "service", but the second one ( with the off and on argument ) is "chkconfig" !!


Next time you want to service your car, remember how easy and effortless that was in Linux !



Bruno


-- Jan 25 2005 ( Revised Dec 12 2005 ) --


Tips Linux Explorers   All Things Linux Forum   Great Linux Links   LinuxClues.com   Hometown