CentOS Script Dependencies

How to determine dependencies between init scripts in CentOS?

For example, I need it to start the soffice service when starting the tomcat service.

In Gentoo, we can do:

depend() {
  need soffice
}

But what about CentOS?

+3
source share
2 answers

CentOS out of the box uses an integer to indicate start / stop.

If you look inside the init script, you will most likely see: chkconfig: - 85 15

First number: launch priority (higher = lower priority)

Second: stop priority (lower = lower priority)

If you jump in /etc/rc3.d(or depending on the run level).

S (start) K (kill, stop), . .

: chkconfig: - 2345 85 15

, .

(2,3,4,5).

+6

init script:

### BEGIN INIT INFO
....
### END INIT INFO

, - :

### BEGIN INIT INFO
# Provides:          tomcat
# Required-Start:    $network
# Required-Stop:     $network
# Default-Start:     3 4 5
# Default-Stop:      0 1 6
# X-Start-Before:    soffice
# Short-Description: xxxx
# Description:       xxxx
### END INIT INFO

: https://wiki.debian.org/LSBInitScripts

, tomcat:

chkconfig --del tomcat
chkconfig --add tomcat
+2

Source: https://habr.com/ru/post/1752795/


All Articles