Short Tip: Managing system services on the command line

shell.png
On Fedora systems the run level configuration of system services can easily be done via the gui tool system-config-services. However, in case there is no X installed this can also be done by the command line tool chkconfig:

# chkconfig --list|grep httpd
httpd           0:Aus   1:Aus   2:Aus   3:Aus   4:Aus   5:Aus   6:Aus
# chkconfig --level 345 httpd on
# chkconfig --list|grep httpd
httpd           0:Aus   1:Aus   2:Aus   3:Ein   4:Ein   5:Ein   6:Aus
# chkconfig --level 345 httpd off
# chkconfig --list|grep httpd
httpd           0:Aus   1:Aus   2:Aus   3:Aus   4:Aus   5:Aus   6:Aus

This works also on Mandriva and Opensuse. On Ubuntu, which is Debian based, there is a similar tool available, sysv-rc-conf:

# sysv-rc-conf --list|grep cups
cupsys           1:off   2:off   3:off   4:off   5:off
# sysv-rc-conf --level 345 cupsys on
# sysv-rc-conf --list|grep cups
cupsys           1:off   2:off   3:on   4:on   5:on

Of course on all systems you can still manually create symlinks to control the start and stop times of the services.

5 thoughts on “Short Tip: Managing system services on the command line”

  1. On debian like, people use update-rc.d, as sysv-rc-conf is not installed by default ( that’s the first time i heard, i guess i will give a try ).

    And to be complete, the command is update-rc on gentoo, and so far, I think it has one of the saner interface I have seen. You can name the various “runlevel”, and you simply tell ” update-rc add foo default” to start it with default runlevel, without checking /etc/inittab to see what is the default.

Comments are closed.