How to modify the service start and stop of the system under LINUX __linux

Source: Internet
Author: User
Each time the system is powered on, different services are started depending on the runlevel level.

As we all know, Linux provides us with 7 different startup levels 0~6, so different startup levels start those services. You can use Chkconfig--list to view that you can use the Chkconfig service name--level 3 {on|of} to modify whether to start or stop at a certain level.

1. For example: To stop the sshd service at the 3rd boot level.

[Root@team4 rc3.d]# chkconfig sshd--level 3 off

2. It can also be manually modified, in the/etc/rc.d/directory, there are many different runlevel corresponding directories, which indicate the level of entry to start and stop those services.

For example:

[Root@team4 etc]# ls/etc/rc.d init.d rc0.d rc2.d rc4.d rc6.d rc.sysinit rc rc1.d rc3.d rc5.d rc.local We use the directory of RC3.D for example, this directory Inside the record is entered Init 3 o'clock need to stop and start those services. The following is the contents of the RC3.D directory: [root@team4 etc]# ls/etc/rc.d/rc3.d/k02avahi-dnsconfd k89pand s25bluetooth k02dhcdbd K89rdisc-S25netfs K 02NetworkManager k91capi s25pcscd k02networkmanagerdispatcher k99readahead_later s26apmd K05conman S04readahead_early S26hidd

The beginning of K represents the service that the startup level needs to stop, and the number is the order of execution when it stops, and then the service is clear.

s starts with those services.

Note: Start with K first, followed by execution S. So the service at the beginning of S will overwrite the service at the beginning of K.

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.