CHKCONFIG(8)
๐ CHKCONFIG(8) ๐
okay bestie, welcome to the System Manager's Manual page for chkconfig, and no this is not a drill, this thing is literally the girlboss who runs your services at boot. let's get into it ๐
โจ NAME โจ
chkconfig โ updates and queries runlevel information for system services ๐
๐ธ SYNOPSIS ๐ธ
chkconfig [--list] [--type type] [name]
chkconfig --add name
chkconfig --del name
chkconfig --override name
chkconfig [--level levels] [--type type] [--no-redirect] name
<on|off|reset|resetpriorities>
chkconfig [--level levels] [--type type] [--no-redirect] name
๐ฆ DESCRIPTION ๐ฆ
okay so chkconfig is your lil' bestie command-line tool for maintaining the /etc/rc[0-6].d directory hierarchy. it exists so that system admins never, ever have to sit there directly messing with the numerous symbolic links in those directories. we do not do that anymore. periodt. ๐
โโ๏ธ
ngl, this implementation of chkconfig was inspired by the chkconfig command that lives in the IRIX operating system. BUT โ and this is the plot twist โ instead of keeping configuration info outside the /etc/rc[0-6].d hierarchy, this version goes straight in and manages the symlinks in /etc/rc[0-6].d directly. which means all the config info about what services init starts lives in one single location. iconic, honestly. โจ
chkconfig has five distinct functions, and yes she does all of them:
- adding new services for management
- removing services from management
- listing the current startup information for services
- changing the startup information for services
- checking the startup state of a particular service
when you run chkconfig with only a service name, it checks whether that service is configured to be started in the current runlevel. if it is, chkconfig returns true. if it isn't, it returns false. simple as. the --level option lets you make it query a different runlevel instead of the current one.
when you run chkconfig with the --list argument โ or with no arguments at all โ you get a listing of all the services and their current configuration. a whole little lineup. ๐ซถ
if one of on, off, reset, or resetpriorities shows up after the service name, chkconfig changes the startup information for that service. here's the tea:
onandoffcause the service to be started or stopped, respectively, in the runlevels being changed.resetresets the on/off state for all runlevels for the service to whatever is specified in the init script in question.resetprioritiesresets the start/stop priorities for the service to whatever is specified in the init script.
by default, the on and off options only affect runlevels 2, 3, 4, and 5, while reset and resetpriorities affect all of the runlevels. the --level option is how you say which runlevels are the ones getting touched.
note that for every service, each runlevel has either a start script or a stop script. when switching runlevels, init will not re-start an already-started service, and will not re-stop a service that is not running. she's efficient like that ๐
chkconfig can also manage xinetd scripts via xinetd.d configuration files. but listen โ only the on, off, and --list commands are supported for xinetd.d services. that's the limit, bestie.
also, chkconfig supports a --type argument to limit actions to only a specific type of services, for those situations where services of either type might share a name. the possible values for type are sysv and xinetd. ๐ง
๐ OPTIONS ๐
--levellevels โ Specifies the run levels an operation should pertain to. it's given as a string of numbers from0to6. for example,--level 35specifies runlevels3and5. easy peasy.--no-redirectโ whenchkconfigis run on a system that uses systemd as its init system,chkconfigwill forward commands to systemd if a systemd service file exists for it. this switch turns off the redirection to systemd and only operates on the symlinks in/etc/rc[0-6].d. this option is only valid whenon,off, or no command (to check enablement) is passed to a service.--addname โ this option adds a new service for management bychkconfig. when a new service is added,chkconfigensures that the service has either a start or a kill entry in every runlevel. if any runlevel is missing such an entry,chkconfigcreates the appropriate entry as specified by the default values in the init script. note that default entries in LSB-delimited'INIT INFO'sections take precedence over the default runlevels in the initscript; if anyRequired-StartorRequired-Stopentries are present, the start and stop priorities of the script will be adjusted to account for these dependencies. ๐ฅ--delname โ the service is removed fromchkconfigmanagement, and any symbolic links in/etc/rc[0-6].dwhich pertain to it are removed.
note that future package installs for this service may runchkconfig --add, which will re-add such links. to disable a service, runchkconfig name off. (different thing! don't get it twisted ๐ญ)
--overridename โ if service name is configured exactly as it would be if the--addoption had been specified with no override file in/etc/chkconfig.d/name, and if/etc/chkconfig.d/namenow exists and is specified differently from the base initscript, change the configuration for service name to follow the overrides instead of the base configuration. glow-up via config file โจ--listname โ this option lists all of the services whichchkconfigknows about, and whether they are stopped or started in each runlevel. if name is specified, information is displayed about service name only. ๐
๐ RUNLEVEL FILES ๐
every service that should be manageable by chkconfig needs two or more commented lines added to its init.d script.
- the first line tells
chkconfigwhat runlevels the service should be started in by default, plus the start and stop priority levels. if the service should not, by default, be started in any runlevels, a-should be used in place of the runlevels list. - the second line contains a description for the service, and it may be extended across multiple lines with backslash continuation.
for example, random.init has these three lines:
# chkconfig: 2345 20 80
# description: Saves and restores system entropy pool for \
# higher quality random number generation.
so this says the random script should be started in levels 2, 3, 4, and 5, that its start priority should be 20, and that its stop priority should be 80. you should be able to figure out what the description says; the \ causes the line to be continued. the extra space in front of the line is ignored. ๐
chkconfig also supports LSB-style init stanzas, and will apply them in preference to "chkconfig:" lines where available. an LSB stanza looks like:
### BEGIN INIT INFO
# Provides: foo
# Required-Start: bar
# Defalt-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: Foo init script
### END INIT INFO
in this case, the start priority of "foo" would be changed such that it is higher than the "bar" start priority, if "bar" is enabled.
care must be taken when adding dependencies, as they can cause vast shifts in the start and stop priorities of many scripts. like, a domino effect, fr fr ๐
๐ OVERRIDE FILES ๐
files in /etc/chkconfig.d/servicename are parsed using the same comments that chkconfig notices in init service scripts, and they override values in the init service scripts themselves. main character energy, honestly. ๐
โญ SEE ALSO โญ
init(8) ntsysv(8) system-config-services(8)
๐ AUTHOR ๐
Erik Troan <ewt@redhat.com>
and that's the whole page, bestie ๐ซถ this was the 4th Berkeley Distribution version, dated Wed Oct 8 1997 โ yeah she's vintage, she's a classic, she ate and left no crumbs ๐โจ๐
๐ฆ where this page comes from
- centos-stream 10: chkconfig 1.30-2.el10 ยท GPL-2.0-only
- centos-stream 9: chkconfig 1.24-2.el9 ยท GPL-2.0-only
- fedora 43: chkconfig 1.33-2.fc43 ยท GPL-2.0-only
- fedora 43: chkconfig 1.33-3.fc43 ยท GPL-2.0-only
- fedora 44: chkconfig 1.33-5.fc44 ยท GPL-2.0-only
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms