4. use chkconfig -- add to add the service to be started. no myservice is found.
Chkconfig -- add myservice
System prompt: service myservice does not support chkconfig
5. View help, man chkconfig,/example
The script format of the service is as follows:
# Chkconfig: Startup level startup sequence SXX close sequence KXX
# Description: description
Vim/etc/init. d/myservice, add the code:
# Chkconfig: 35 24 25
# Description: this is a test
6. add the system boot auto start service
Chkconfig -- add myservice
Chkconfig -- list myservice
Myservice 0: off 1: off 2: off 3: on 4: off 5: on 6: off
Start myservice when the startup level is 3 or 5.
7. view the added service
Ls/etc/rc. d/rc *. d/* myservice, you can see:
/Etc/rc. d/rc0.d/K25myservice/etc/rc. d/rc4.d/K25myservice
/Etc/rc. d/rc1.d/K25myservice/etc/rc. d/rc5.d/S24myservice
/Etc/rc. d/rc2.d/K25myservice/etc/rc. d/rc6.d/K25myservice
/Etc/rc. d/rc3.d/S24myservice
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.