1CHKCONFIG(8) System Manager's Manual CHKCONFIG(8)
2
3
4
6 chkconfig - updates and queries runlevel information for system ser‐
7 vices
8
9
11 chkconfig [--list] [--type type] [name]
12 chkconfig --add name
13 chkconfig --del name
14 chkconfig --override name
15 chkconfig [--level levels] [--type type] [--no-redirect] name
16 <on|off|reset|resetpriorities>
17 chkconfig [--level levels] [--type type] [--no-redirect] name
18
19
21 chkconfig provides a simple command-line tool for maintaining the
22 /etc/rc[0-6].d directory hierarchy by relieving system administrators
23 of the task of directly manipulating the numerous symbolic links in
24 those directories.
25
26 This implementation of chkconfig was inspired by the chkconfig command
27 present in the IRIX operating system. Rather than maintaining configu‐
28 ration information outside of the /etc/rc[0-6].d hierarchy, however,
29 this version directly manages the symlinks in /etc/rc[0-6].d. This
30 leaves all of the configuration information regarding what services
31 init starts in a single location.
32
33 chkconfig has five distinct functions: adding new services for manage‐
34 ment, removing services from management, listing the current startup
35 information for services, changing the startup information for ser‐
36 vices, and checking the startup state of a particular service.
37
38 When chkconfig is run with only a service name, it checks to see if the
39 service is configured to be started in the current runlevel. If it is,
40 chkconfig returns true; otherwise it returns false. The --level option
41 may be used to have chkconfig query an alternative runlevel rather than
42 the current one.
43
44 When chkconfig is run with the --list argument, or no arguments at all,
45 a listing is displayed of all services and their current configuration.
46
47 If one of on, off, reset, or resetpriorities is specified after the
48 service name, chkconfig changes the startup information for the speci‐
49 fied service. The on and off flags cause the service to be started or
50 stopped, respectively, in the runlevels being changed. The reset flag
51 resets the on/off state for all runlevels for the service to whatever
52 is specified in the init script in question, while the resetpriorities
53 flag resets the start/stop priorities for the service to whatever is
54 specified in the init script.
55
56 By default, the on and off options affect only runlevels 2, 3, 4, and
57 5, while reset and resetpriorities affects all of the runlevels. The
58 --level option may be used to specify which runlevels are affected.
59
60 Note that for every service, each runlevel has either a start script or
61 a stop script. When switching runlevels, init will not re-start an
62 already-started service, and will not re-stop a service that is not
63 running.
64
65 chkconfig also can manage xinetd scripts via the means of xinetd.d con‐
66 figuration files. Note that only the on, off, and --list commands are
67 supported for xinetd.d services.
68
69 chkconfig supports a --type argument to limit actions to only a spe‐
70 cific type of services, in the case where services of either type may
71 share a name. Possible values for type are sysv and xinetd.
72
73
75 --level levels
76 Specifies the run levels an operation should pertain to. It is
77 given as a string of numbers from 0 to 6. For example, --level
78 35 specifies runlevels 3 and 5.
79
80
81 --no-redirect
82 When chkconfig is run on a system that uses systemd as its init
83 system, chkconfig will forward commands to systemd if a systemd
84 service file exists for it. This switch turns off the redirect‐
85 ion to systemd and only operates on the symlinks in
86 /etc/rc[0-6].d. This option is only valid when on, off, or no
87 command (to check enablement) is passed to a service.
88
89
90 --add name
91
92 This option adds a new service for management by chkconfig.
93 When a new service is added, chkconfig ensures that the service
94 has either a start or a kill entry in every runlevel. If any
95 runlevel is missing such an entry, chkconfig creates the appro‐
96 priate entry as specified by the default values in the init
97 script. Note that default entries in LSB-delimited 'INIT INFO'
98 sections take precedence over the default runlevels in the
99 initscript; if any Required-Start or Required-Stop entries are
100 present, the start and stop priorities of the script will be
101 adjusted to account for these dependencies.
102
103
104 --del name
105 The service is removed from chkconfig management, and any sym‐
106 bolic links in /etc/rc[0-6].d which pertain to it are removed.
107
108 Note that future package installs for this service may run chk‐
109 config --add, which will re-add such links. To disable a ser‐
110 vice, run chkconfig name off.
111
112
113 --override name
114 If service name is configured exactly as it would be if the
115 --add option had been specified with no override file in
116 /etc/chkconfig.d/name, and if /etc/chkconfig.d/name now exists
117 and is specified differently from the base initscript, change
118 the configuration for service name to follow the overrides
119 instead of the base configuration.
120
121
122 --list name
123 This option lists all of the services which chkconfig knows
124 about, and whether they are stopped or started in each runlevel.
125 If name is specified, information in only display about service
126 name.
127
128
130 Each service which should be manageable by chkconfig needs two or more
131 commented lines added to its init.d script. The first line tells chk‐
132 config what runlevels the service should be started in by default, as
133 well as the start and stop priority levels. If the service should not,
134 by default, be started in any runlevels, a - should be used in place of
135 the runlevels list. The second line contains a description for the
136 service, and may be extended across multiple lines with backslash con‐
137 tinuation.
138
139 For example, random.init has these three lines:
140 # chkconfig: 2345 20 80
141 # description: Saves and restores system entropy pool for \
142 # higher quality random number generation.
143 This says that the random script should be started in levels 2, 3, 4,
144 and 5, that its start priority should be 20, and that its stop priority
145 should be 80. You should be able to figure out what the description
146 says; the \ causes the line to be continued. The extra space in front
147 of the line is ignored.
148
149 chkconfig also supports LSB-style init stanzas, and will apply them in
150 preference to "chkconfig:" lines where available. A LSB stanza looks
151 like:
152 ### BEGIN INIT INFO
153 # Provides: foo
154 # Required-Start: bar
155 # Defalt-Start: 2 3 4 5
156 # Default-Stop: 0 1 6
157 # Description: Foo init script
158 ### END INIT INFO
159
160 In this case, the start priority of "foo" would be changed such that it
161 is higher than the "bar" start priority, if "bar" is enabled. Care
162 must be taken when adding dependencies, as they can cause vast shifts
163 in the start and stop priorities of many scripts.
164
165
167 Files in /etc/chkconfig.d/servicename are parsed using the same com‐
168 ments that chkconfig notices in init service scripts, and override val‐
169 ues in the init service scripts themselves.
170
171
173 init(8) ntsysv(8) system-config-services(8)
174
175
177 Erik Troan <ewt@redhat.com>
178
179
180
1814th Berkeley Distribution Wed Oct 8 1997 CHKCONFIG(8)