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.

On a Ubuntu 10.04.1 LTS server install certain services fail to start properly after a reboot.

I have a couple of virtual interfaces defined on eth0:

/etc/network/interfaces

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
    address 172.16.5.240
    netmask 255.255.255.0
    gateway 172.16.5.1

auto eth0:1
iface eth0:1 inet static
    address 172.16.5.241
    netmask 255.255.255.0
    gateway 172.16.5.1

auto eth0:2
iface eth0:2 inet static
    address 172.16.5.242
    netmask 255.255.255.0
    gateway 172.16.5.1

auto eth0:3
iface eth0:3 inet static
    address 172.16.5.243
    netmask 255.255.255.0
    gateway 172.16.5.1

and so on...

Some SysV init scripts that try to bind to for example 172.16.5.243 fail during boot, complaining that there is no such IP address.

My questions:

1) Are the services started parallel by default? Can I disable that so they run sequentially?

2) Is there a way to define dependencies between rc scripts? I'm only familiar with the defining the order of seqentially started scripts using the numbers in /etc/rc[0-6].d/)

Any other fix or workaround appreciated.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

There is no clear answer to your question. It depends whether the service which needs 172.16.5.243 is a SysV init script or a upstart job.

When it is a SysV init script, you can add dependencies with this header in the init script:

### BEGIN INIT INFO
# Provides:          scriptname
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start daemon at boot time
# Description:       Enable service provided by daemon.
### END INIT INFO

When it is an Upstart script, take a look at this post. The interesting part is in the accepted answer:

start on (local-filesystems and net-device-up IFACE=eth0)
share|improve this answer
    
They are SysV init scripts, depending on $network in Required-Start. Who provides $network? /etc/init.d/networking provides "networking". –  chris Jan 3 '11 at 13:44
    
You could also change Required-Start $network to Required-Start $networking. Or perhaps there is an update which corrects this. –  Christian Jan 3 '11 at 14:19
    
The system is updated to the current state of 10.4 LTS. Loads of other system scripts use network instead of networking. Are you sure this is a bug? –  chris Jan 4 '11 at 11:50
    
No I'm not. This was just a possibility. –  Christian Jan 4 '11 at 11:54

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.