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] name <on|off|reset|resetprior‐
16 ities>
17 chkconfig [--level levels] [--type type] 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 specifed 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 --add name
82
83 This option adds a new service for management by chkconfig.
84 When a new service is added, chkconfig ensures that the service
85 has either a start or a kill entry in every runlevel. If any
86 runlevel is missing such an entry, chkconfig creates the appro‐
87 priate entry as specified by the default values in the init
88 script. Note that default entries in LSB-delimited 'INIT INFO'
89 sections take precedence over the default runlevels in the
90 initscript; if any Required-Start or Required-Stop entries are
91 present, the start and stop priorities of the script will be
92 adjusted to account for these dependencies.
93
94
95 --del name
96 The service is removed from chkconfig management, and any sym‐
97 bolic links in /etc/rc[0-6].d which pertain to it are removed.
98
99 Note that future package installs for this service may run chk‐
100 config --add, which will re-add such links. To disable a ser‐
101 vice, run chkconfig name off.
102
103
104 --override name
105 If service name is configured exactly as it would be if the
106 --add option had been specified with no override file in
107 /etc/chkconfig.d/name, and if /etc/chkconfig.d/name now exists
108 and is specified differently from the base initscript, change
109 the configuration for service name to follow the overrides
110 instead of the base configuration.
111
112
113 --list name
114 This option lists all of the services which chkconfig knows
115 about, and whether they are stopped or started in each runlevel.
116 If name is specified, information in only display about service
117 name.
118
119
121 Each service which should be manageable by chkconfig needs two or more
122 commented lines added to its init.d script. The first line tells chk‐
123 config what runlevels the service should be started in by default, as
124 well as the start and stop priority levels. If the service should not,
125 by default, be started in any runlevels, a - should be used in place of
126 the runlevels list. The second line contains a description for the
127 service, and may be extended across multiple lines with backslash con‐
128 tinuation.
129
130 For example, random.init has these three lines:
131 # chkconfig: 2345 20 80
132 # description: Saves and restores system entropy pool for \
133 # higher quality random number generation.
134 This says that the random script should be started in levels 2, 3, 4,
135 and 5, that its start priority should be 20, and that its stop priority
136 should be 80. You should be able to figure out what the description
137 says; the \ causes the line to be continued. The extra space in front
138 of the line is ignored.
139
140 chkconfig also supports LSB-style init stanzas, and will apply them in
141 preference to "chkconfig:" lines where available. A LSB stanza looks
142 like:
143 ### BEGIN INIT INFO
144 # Provides: foo
145 # Required-Start: bar
146 # Defalt-Start: 2 3 4 5
147 # Default-Stop: 0 1 6
148 # Description: Foo init script
149 ### END INIT INFO
150
151 In this case, the start priority of "foo" would be changed such that it
152 is higher than the "bar" start priority, if "bar" is enabled. Care
153 must be taken when adding dependencies, as they can cause vast shifts
154 in the start and stop priorities of many scripts.
155
156
158 File in /etc/chkconfig.d/servicename are parsed using the same comments
159 that chkconfig notices in init service scripts, and override values in
160 the init service scripts themselves.
161
162
164 init(8) ntsysv(8) system-config-services(8)
165
166
168 Erik Troan <ewt@redhat.com>
169
170
171
1724th Berkeley Distribution Wed Oct 8 1997 CHKCONFIG(8)