46. Linux Shell Command, chkconfig

Source: Internet
Author: User

1. Description

Chkconfig [-- add] [-- del] [-- list] [System Service]

Chkconfig [-- level <level code>] [System Service] [ON/OFF/Reset]

Chkconfig provides a simple command-line tool for maintaining the/etc/rc [0-6]. d directory hierarchy by relieving system administrators of the task of directly manipulating the numerous symbolic links in those directories.

2,Option

①Add to add the specified system serviceChkconfigCommand to manage it, and add relevant data in the system startup narrative file.

②Del deletes the specified system service.ChkconfigCommand management, and delete related data in the system startup description file.

③Level <level code>Specify the execution level of the read system service.

3. Others

1) the running level is the current running function level of the operating system. This level starts from 0 to 6 . /etc/inittab init main files that the Program looks for. The first services that run are placed in /etc/rc. d files in the directory.

2) running level

3: multi-user mode with network support

5. Network SupportX-WindowSupported multi-user mode

4. Example

Chkconfig -- list all system services

Chkconfig -- add httpd addedHttpdService

Chkconfig -- del httpd DeleteHttpdService

Chkconfig -- level 2345 Httpd onHttpdThe running level is2,3,4,5In this caseOn(Enabled) status.

Chkconfig -- level 5 sshd on

5. Execute similar Chkconfig rsync on The service is started immediately. However, Chkconfig -- level 345 nscd off Will not stop automatically Nscd Service, but it takes effect only after the system is restarted. You can use Service <service> <action> Command ; Where <Service> Is the service name, <Action> Is the operation action, can be Start ( Start ) , Stop ( Stop ) , Restart ( Restart ) .

6,ChkconfigCommand to add a service:

①Service scripts must be stored in/Etc/INI. d/Directory

② chkconfig -- add servicename // in chkconfig this service is added to the service list, the service is /etc/rc. d/rcN. d K/S entry

③Chkconfig -- level 35 mysqld on

Modify the default service start level.

Reference

[ 1 ] http://linux.die.net/man/8/chkconfig

[ 2 ] http://www.cnblogs.com/Vegaslee/archive/2011/01/27/1946066.html

[ 3 ] http://lugir.com/story/185.html

【4]Http:// OS .51cto.com/art/201006/207648.htm

[5]Description of/etc/inittab

http://hi.baidu.com/lianxi1999/blog/item/75c9eb0f870549eeaa64570c.html

Related Article

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.