Linux update and query command chkconfig details

  
                      Linux provides the chkconfig command to update and query system services at different run levels. The syntax is: chkconfig --list [name] is used to list the service chkconfig --add name to add the service chkconfig --del name to delete the service chkconfig [--level levels] name change the startup information and check the startup status of a specific service . On and off refer to the start and stop of the service when it changes the run level, respectively. Reset refers to initializing service information. For the on and off switches, the system is only valid for run levels 3, 4, 5 by default, but reset can be active for all run levels. Option Description: --level levels Specify the run level, a string consisting of the numbers 0 to 7, such as: --level 35 means to specify runlevels 3 and 5. --add name This option adds a new service, chkconfig ensures Each run level has a start (S) or kill (K) entry. If it is missing, it will be automatically created from the default init script. --del name is used to delete the service and remove the associated symbolic link from /etc/rc[0-6].d. --list name list, if name is specified then only the specified service name is displayed, otherwise, all services are listed at different runlevels. Runlevel files Each service managed by chkconfig needs to be appended with two or more lines of comments in the script under /etc/rc.d/init.d. The first line tells chkconfig the run level of the default start and the priority of start and stop. If a service is not started by default at any runlevel, use - instead of runlevel. The second line describes the service and can be commented with \\ cross-row. For example, random.init contains three lines: # chkconfig: 2345 20 80 # description: Saves and restores system entropy pool for \\ # higher quality random number generation. Indicates that the random script should be started at run level 2, 3, 4, 5, starting The priority is 20 and the priority is 80.
Copyright © Windows knowledge All Rights Reserved