0

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.

chris
  • 432
  • 4
  • 9

1 Answers1

1

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)
Christian
  • 4,645
  • 2
  • 23
  • 27
  • They are SysV init scripts, depending on $network in Required-Start. Who provides $network? /etc/init.d/networking provides "networking". – chris Jan 03 '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 03 '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 04 '11 at 11:50
  • No I'm not. This was just a possibility. – Christian Jan 04 '11 at 11:54