Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

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.

share|improve this answer
    
What does one invoke to update the rcN.d-symlinks with the new values, though? –  Kvisle Oct 21 '11 at 5:05
    
How about dpkg-reconfigure insserv sysv-rc: wiki.debian.org/LSBInitScripts/DependencyBasedBoot –  quanta Oct 21 '11 at 5:12
    
What about having apache2 load after openvpn. I'm not sure that changing lsb scrpits for apache2 is a solution. –  rmarimon Oct 21 '11 at 5:29
1  
There's nothing wrong with patching the init-scripts. It's like any other configuration file - you need to pay attention when you upgrade to a newer version, and apt will present you with a diff (because it detects that you've edited the file). The same would apply if you were using upstart, and patching the upstart-configfiles. –  Kvisle Oct 21 '11 at 6:16
    
I always thought that patching the init-scripts was a no-no. Particularly in trying to keep maintainability going forward. This is perhaps one of the reasons for having /etc/default/*. Perhaps there is something similar for lsb scripts? –  rmarimon Oct 22 '11 at 0:15

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.