SUSE service startup sequence

The issue of the startup order of SUSE services finally stimulated me, and I had to take a serious look. When I used RedHat, I used chkconfig to adjust the order of startup scripts. For example,
# chkconfig: 35 98 01
This indicates that I want this service to be enabled on runlevels 3 and 5, and disabled otherwise. The startup sequence when enabled is 98, which is already very late, and the stop sequence is 01, which is quite advanced.
However, in SLES, everything has changed, and this way of specifying is no longer easy to use (note that it is not impossible to use, but there are restrictions). SUSE has introduced a new startup sequence configuration method, I call it the before/after method, and the related command used is insserv. The way to configure it is to add some comments to the script, yes, like this:

### 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
Explained here,

Provides: Specifies the name of the program or service controlled by this init script.
Required-Start: Indicates the name of the service that needs to be started before its own service is started.
Required-Stop: Specifies the name of the service that needs to be stopped before its own service is stopped.
Default-Start: Specifies the runlevel at which the service is automatically started.
Default-Stop: Specifies the runlevel at which the service automatically stops.
Description: A description of the service.

Then to do is, 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, and create it under the corresponding runlevel (/etc/init.d/rc?.d/) directory to the /etc/init.d/ directory Script start, stop linking. insserv also writes start and stop dependencies between services to the files .depend.start file and .depend.stop.
Gosh, it looks like SUSE's way of handling it is not too bad, don't worry about how many startup sequence numbers to set for scripts. Moreover, it can automatically write dependencies and automatically create the corresponding startup scripts (in fact, only the startup sequence number is given, and a link to the startup script is created).
It is said that this way SUSE handles startup scripts conforms to a standard called LSB. Interested friends can click here or visit www.linuxidc.com here.

So, what are the limitations of using chkconfig to configure startup scripts in SUSE?

It can only simply solve the problem of automatic startup of scripts under /etc/init.d/, but cannot define the start-stop dependencies between scripts . Of course no dependencies are created either.
So, is it possible to use such a handsome configuration method in SUSE in Redhat?
If the LSB related packages are installed, it seems to be possible.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326971261&siteId=291194637