In the linux environment, the digital _ chkconfig-general Linux technology-Linux programming and kernel information. The following is a detailed description. Numbers in linux
Permission
0 is not authorized
1 x
2 w
3 wx
4 r
5 rx
6 rw
7 rwx
Running level
More/etc/inittab
# Default runlevel. The runlevels used by RHS are:
#0-halt (Do NOT set initdefault to this)
#1-Single user mode
#2-Multiuser, without NFS (The same as 3, if you do not have networking)
#3-Full multiuser mode
#4-unused
#5-X11
#6-reboot (Do NOT set initdefault to this)
The chkconfig command is used to update (start or stop) and query the running level information of the system service. Remember that chkconfig does not automatically disable or activate a service immediately, but simply changes the symbolic connection.
Syntax:
Chkconfig -- list [name]
Chkconfig -- add name
Chkconfig -- del name
Chkconfig [-- level levels] name
Chkconfig [-- level levels] name
When chkconfig does not have a parameter for running, the usage is displayed. If the service name is added, check whether the service is started at the current running level. If yes, true is returned; otherwise, false is returned. If on, off, or reset is specified after the service name, chkconfi changes the startup information of the specified service. On and off indicate that the service is started and stopped, and reset indicates that the Service Startup information is reset, no matter what is specified by the problematic initialization script. On and off switches. By default, the system is only valid for 3, 4, and 5 running levels, but the reset can be valid for all running levels.
The -- level option specifies the running level to be viewed, not necessarily the current running level.
It must be noted that for each running level, there can be only one start script or stop script. When you switch to the running level, init does not restart the started service or stop the stopped service again.
Chkconfig -- list: displays the running status information (on or off) of all running system services ). If the name is specified, only the status of the specified service at different running levels is displayed.
Chkconfig -- add name: add a new service. Chkconfig ensures that each running level has a startup (S) or kill (K) entry. If the init script is missing, it is automatically created from the default init script.
Chkconfig -- del name: Delete the service and delete the connection from/etc/rc [0-6]. d.
Chkconfig [-- level levels] name : Sets whether a service is started, stopped, or reset at the specified running level. For example, to stop the nfs service at level 3, 4, and 5, the command is as follows:
Chkconfig -- level 345 nfs off
Run-level files:
Each service managed by chkconfig needs to add two or more lines of comments to the script in the corresponding init. d. The first line tells chkconfig the default startup running level and the priority of start and stop. If a service is not started at any running level by default, use-to replace the running level. The second line describes the service. You can use the \ cross-line comment.
For example, random. init contains three rows:
# Chkconfig: 2345 20 80
# Descr resume ption: Saves and restores system entropy pool \
# Higher quality random number generation.
This document introduces the concept of running level in Linux:
In Linux, there are multiple running levels, common being 2, 3, 4, and 5 for multiple users. Many people know that 5 is the level for running X-Windows, while 0 is the shutdown. You can use the init command to change the running level. For example, if you want to maintain the system to enter the single-user status, you can use init1 to switch. During the Linux running-level switch, the system will automatically find the corresponding running-level directory/etc/rc [0-6]. files starting with K and S under d are executed in numerical order. The maintenance of these scripts is cumbersome. Linux provides the chkconfig command to update and query system services at different running levels.
Running files
Each service managed by chkconfig needs to add two or more lines of comments to the script under/etc/rc. d/init. d.
The first line tells chkconfig the default startup running level and the priority of start and stop. If a service is not started at any running level by default, use-to replace the running level.
The second line describes the service. You can use the \ cross-line comment.
For example, random. init contains three rows:
# Chkconfig: 2345 20 80
# Descr resume ption: Saves and restores system entropy pool \
# Higher quality random number generation.
It indicates that the random script should be started at runtime Level 2, 3, 4, 5. The start priority is 20, and the Stop priority is 80.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service