Suse service startup sequence analysis

Source: Internet
Author: User
The Suse service startup sequence Suse finally gave me some excitement. I had to take a serious look at the sequence of startup scripts adjusted with chkconfig when I used Redhat. For example, # chkconfig: 359801 indicates that I want this service to be deployed in ru... I was finally excited about the Suse service startup sequence. I had to take a serious look at it. in the past, when I used Redhat, I used chkconfig to adjust the sequence of startup scripts. For example, # chkconfig: 35 98 01 indicates that I want to enable this service when runlever 3 and 5, and disable it in other cases. The start sequence is 98, which is very backward. the stop sequence is 01, which is quite advanced. However, in SLES, everything has changed. this method is no longer useful (note: it is not useless, it is limited ). SUSE introduces a new method for configuring the startup sequence, which is called before/after. the related command used is insserv. The configuration method is to add some comments to the script, which is correct, just like this: www.2cto.com ### begin init info # Provides: Tomcat # Required-Start: $ network oracle-xe # Required-Stop: $ network # Default-Start: 2 3 5 # Default-Stop: 0 1 2 6 # Description: start Tomcat server ### end init info here, Provides: specifies the name of the program or service controlled by the init script. Required-Start: specifies the name of the service to be started before the service starts. Required-Stop: indicates the name of the service that needs to be stopped before the service is stopped. Default-Start: specifies the runlevel level for automatic service startup. Default-Stop: indicates the runlevel of automatic service Stop. Description: service Description.
Then, run the command insserv. The insserv command will check the content of this part of the script, corresponding to the Default-Start and Default-Stop definitions, in the corresponding runlevel (/etc/init. d/rc ?. D/) create a script in the/etc/init. d/directory to start and stop the link. Insserv also writes the startup and stop dependencies between services to the file. depend. start file and. depend. stop. Oh, my God, it seems that the SUSE processing method is still full, so you don't have to worry about setting the startup sequence number for the script. In addition, the dependency can be automatically written to automatically create the corresponding startup script (in fact, only the startup sequence number is given and a link to the startup script is created ). Www.2cto.com it is said that SUSE handles the startup script in compliance with a standard called LSB. If you are interested, click here. So what are the restrictions on using chkconfig to configure the startup script in SUSE? it can only be solved simply in/etc/init. d. Of course, no dependency is created. So can we use this handsome configuration method in SUSE in Redhat? if we have installed the LSB package, it seems that we can. Author: jackyyen
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.