Linux Runlevel Tools
Runlevels are handled differently by each flavor of Linux.
RedHat
This applies to any RedHat-derived systems, like Fedora, Mandrake, CentOS, etc... These systems use the chkconfig
utility, as follows:
chkconfig --list httpd
- to see the runlevel statuses of the httpd servicechkconfig httpd on
- turns onhttpd
in runlevels 2-5chkconfig httpd off
- turns offhttpd
in runlevels 2-5chkconfig --add myservice
- addsmyservice
to runlevel management systemchkconfig --del myservice
- removesmyservice
from s runlevel management system
Services handled by xinetd (like finger, telnet, rsync, ...) are enabled/disabled immediately by running an on/off command. Others require manual start/stop using the relevant script in /etc/init.d/*.
Debian
This applies to any Debian-derived system, like Ubuntu, Xandros, Gnoppix, etc... These systems use the update-rc.d
utility, as follows:
update-rc.d apache2 defaults
- turns onapache2
in runlevels 2-5update-rc.d apache2 start 20 2 3 4 5 . stop 20 0 1 6 .
- long-winded way of controlling it yourselfupdate-rc.d apache2 remove
- turn offapache2
for all runlevels
Gentoo
This applies to any Gentoo-derived system. These systems use the update-rc
utility, as follows:
rc-update add myservice default
- addsmyservice
to the default 2-5 runlevelsrc-update del myservice default
- removesmyservice
from the default 2-5 runlevelsrc-update -v show
shows all init scripts and the runlevels they operate in (without the-v
, only the active scripts will be shown.