How to modify system service start and stop -- Linux
Source: Internet
Author: User
How to modify system service start and stop-Linux-general Linux technology-Linux technology and application information is as follows. 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.
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. 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 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:
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.
If you want to modify the service, you only need to modify the file name.
For example
# Mv k89pand S89pand
# Reboot
The pand service is stopped.
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.