Networking with Upstart and sysvinit scripts
Clint Byrum
clint at ubuntu.com
Sat Jan 28 01:26:29 UTC 2012
Excerpts from Christian Roessner's message of Fri Jan 27 12:01:09 -0800 2012:
> Hi,
>
Hi Christian! Glad to hear from you again!
> first of all this is my very first mail here to this list and I am completely unsure, if I am right here. So if this message does not address the right people, I say sorry for this.
>
> My problem is starting from services with Upstart and sysvinit. I am a postmaster and managing several mail servers. And for some of them, I really do have boot issues with Upstart.
>
> To explain:
>
> I have many IPv4 and IPv6 addresses for one server. The problem starts with /etc/network/interfaces. No matter if I put several iface ethX inet(6) static blocks into the config file or adding post-up/pre-down scripts with iproute, it happens every two of three boots, that not all of the addresses were set up correctly. And this causes many services to fail on startup.
>
> As far as I know, this interfaces file is laded through Upstart. And now there is a second problem: Services like amaivs, saslauthd, slapd are started through init.d. And it happens that they fail on startup, because the network has not yet finished being set.
>
> Now there are some services in init (not init.d) that normally depend on started services in init.d. For example dovecot. I also have ported postfix to use Upstart. Maybe Scott and Clint remember the discussion together with Wietse Vennema, where we tried to solve this problem, starting postfix with Upstart.
>
> Now my question:
>
> What can I do to have services in init and init.d to really wait until the _whole_ network was set up correctly? And how can I make dependencies between these to worlds?
>
This is fixed in Ubuntu 11.10 and later.
https://bugs.launchpad.net/ubuntu/+source/dhcp3/+bug/580319
We do not boot to runlevel 2 unless either all "auto" interfaces from
/etc/network/interfaces are up, or 120 seconds have passed since lo
was brought up. This gives ample time for any DHCP or heavy static
configurations/bridge/bonded/etc configurations to finish, but will
continue the boot in case you have listed an interface there that is
broken or will never come up.
> Here is some header from postfix:
>
> start on (started opendkim-sign and
> started opendkim-verify and
> started amavisd-milter)
> stop on runlevel [!2345]
>
> Here you can see missing deps. Amavisd and slapd are missing. Also saslauthd and I do not know how to solve this.
Remember that these are *events*, not dependencies.
Anyway, give 11.10 a try, its possible we will backport something to
lucid, but no guarantees, as its a rather large change in the way we
treat /etc/network/interfaces, and it has not been popular with everyone,
as there are some people abusing /etc/network/interfaces and this causes
their system to take 2 minutes extra too boot.
More information about the upstart-devel
mailing list