Linux introduction how to modify system service startup and stop

Source: Internet
Author: User
Article Title: Linux introduction how to modify system service startup and stop. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

Each time the system is started, different services are started based on different runlevel levels.

As we all know, Linux provides us with different startup levels in 7: 0 ~ 6. Which services will be started at different startup levels. You can use chkconfig -- list to check whether the chkconfig service name -- level 3 {on | of} needs to be started or stopped at a certain level.

1. For example, to stop the sshd service at the 3rd startup levels.

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

2. You can also manually modify it. There are many directories corresponding to different runlevels in the/etc/rc. d/directory, which indicates to start and stop those services when entering a certain startup level.

For example:

     
      
[Root @ team4 etc] # ls/etc/rc. dinit. d rc0.d rc2.d rc4.d rc6.d rc. sysinitrc rc1.d rc3.d rc5.d rc. for local, we use the rc3.d directory as an example. The directory records the services that need to be stopped and started when init 3 is entered. The contents of the rc3.d directory are as follows: [root @ team4 etc] # ls/etc/rc. d/rc3.d/K02avahi-dnsconfd K89pand ~k89rdisc S25netfsK02NetworkManager K91capi ~k99readahead_later %s26hidd
     

Start with "K" indicates the service to be stopped at the startup level. The number indicates the sequence of execution when the service is stopped, and the service is displayed later.

S starts with those services.

Note: first start with K and then start with S. Therefore, services starting with S will overwrite services starting with K.

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.