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.