In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly shows you "how to use the chkconfig command in the Linux system", the content is easy to understand, clear, hope to help you solve your doubts, let the editor lead you to study and learn "how to use the chkconfig command in the Linux system" this article.
The Linux chkconfig command is used to check and set up various services of the system. This is a program developed by Red Hat following the GPL rules, which can query which system services are performed by the operating system at each execution level, including various resident services.
Use syntax
Chkconfig- add&-list or chkconfig-level [on/off/reset]
Chkconfig displays usage when running with no parameters. If you add the service name, check to see if the service is started at the current run level. If yes, return true, otherwise return false. If on,off or reset is specified after the service name, chkconfi changes the startup information of the specified service. On and off refer to the service being started and stopped, respectively, and reset refers to the startup information of the reset service, regardless of what is specified in the problematic initialization script. On and off switches, by default, are only valid for runlevel 3, 4, and 5, but reset is valid for all runlevels.
Parameter usage
-add adds the specified system service so that the chkconfig instruction can manage it, and at the same time adds relevant data to the narrative file started by the system.
-del deletes the specified system service, which is no longer managed by the chkconfig instruction, and deletes the relevant data in the narrative file started by the system.
-level specifies the execution level in which the read system service is enabled or closed.
Level 0 indicates that the computer is turned off
Level 1 means: single user mode
Level 2 means: multi-user command line mode without network connection
Level 3 means: multi-user command line mode with network connection
Level 4 means: not available
Level 5 means: multi-user mode with graphical interface
Level 6 means: restart
It is important to note that the level option specifies the runlevel to view, not necessarily the current runlevel. There can be only one start script or stop script per runlevel. When switching runlevels, init does not restart services that have already been started, nor does it stop services that have been stopped again.
Chkconfig-list [name]: displays operational status information (on or off) for all runlevel system services. If name is specified, only the status of the specified service at different runlevels is displayed.
Chkconfig-add name: add a new service. Chkconfig ensures that each runlevel has a startup (S) or kill (K) entry. If it is missing, it is automatically created from the default init script.
Chkconfig-del name: delete the service and remove the associated symbolic link from / etc/rc [0-6] .d.
Chkconfig [- level levels] name: sets whether a service is started, stopped, or reset at the specified runtime level.
Run-level files:
Each service managed by chkconfig needs to add two or more lines of comments to the script under the corresponding init.d. The first line tells chkconfig the default run level to start and the priority to start and stop. If a service is not started at any runtime level by default, use-instead of runlevel. The second line describes the service and can be commented with\ cross-line comments.
For example, random.init contains three lines:
# chkconfig: 2345 20 80`` # description: Saves and restores system entropy pool for\ ``# higher quality random number generation. Examples of use:
Chkconfig-list # lists all system services
Chkconfig-add httpd # adds httpd services
Chkconfig-del httpd # Delete httpd service
Chkconfig-level httpd 2345 on # sets httpd to be on when runlevels are 2, 3, 4 and 5
Chkconfig-list # lists the startup of all the services in the system
Chkconfig-list mysqld # lists mysqld service settings
Chkconfig-level 35 mysqld on # sets mysqld to boot at levels 3 and 5.-level 35 indicates that the operation is only performed at levels 3 and 5, on indicates start, and off indicates shutdown.
Chkconfig mysqld on # sets mysqld to on at each level, and "each level" includes levels 2, 3, 4 and 5
How to add a service:
Service scripts must be stored in the / etc/ini.d/ directory
Chkconfig-add servicename # adds this service to the list of chkconfig tool services, and the service will be given an entry in / etc/rc.d/rcN.d
Chkconfig-level 35 mysqld on # modifies the default startup level of the service.
The above is all the contents of the article "how to use chkconfig commands in Linux system". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.