3

I just moved to debian squeeze and need to change the startup sequence of some scripts. I used to do this with update-rc.d service defaulta xx xx but now with the LSB way of doing things the update-rc.d method does not change the order.

I need to start the packages in this order:

  • openvpn
  • ndo2db
  • nagios
  • apache2

Any ideas?

2 Answers2

4

Just use Required-Start keyword. For e.g, init script for ndo2db should have the following:

### BEGIN INIT INFO
# Provides:          ndo2db
# Required-Start:    $openvpn
# Required-Stop:     $openvpn
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Daemonized ndo2db
# Description:       Starts the ndo2db daemon
### END INIT INFO

Take a look at this for more details.

quanta
  • 52,423
1

Once you edit the Required-Start lines (and Required-Stop lines) in the appropriate files in your init.d directory, perform the following commands for each of the services you'd like reordered:

chkconfig --del servicename

chkconfig --add servicename

Once you do this, the init scripts will be reordered in your rc#.d directories.