Fun with Upstart
- November 11th, 2009
- Posted in Ubuntu
- By
- Write comment
Yesterday I dist-upgraded an Ubuntu 9.04 Server to an Ubuntu 9.10 Server and ran into a serious problem.
No network interfaces after reboot into 9.10 anymore.
Ok, what do we have here…I’m using a bonding + vlan (with vlan_raw_device bondinterface) setup, and strangely upstart doesn’t want to start that up.
The job which should do that is /etc/init/networking.conf, and the nice Soren Hansen tried to help me to debug this problem. We came up with some workarounds, but somehow they didn’t work. After discussing this issue with Upstart Upstream and Ubuntu Dev Scott James Remnant we were stucked.
Today, I found the time to dig a bit deeper into the Upstart process, and shame oh shame, it looks like that Upstart starts this "networking.conf" job too early, eventually before the needed /etc/init/network-interface.conf job.
Now, after more debugging I found out that somehow the "/var/run/network" directory is missing, but it’s needed for /sbin/ifup .
Ok, we got the bugger, whysoever, now for the fix:
if you have a similar problem, try to add this to your /etc/init/networking.conf:
<after the "task" keyword">script mkdir -p /var/run/network exec ifup -aend script<delete the last exec ifup -a line in the script>
Please try it out…I pushed the fix to lp: #446031
I wonder if this is really the bugger, and there is a timing problem between /etc/init/networking.conf and /etc/init/network-interface.conf

Do you have /var on its own partition? If so you should use e2mkdir to make run/network on that partition.
/var/run is is normally a tmpfs and e2mkdir is not installed by default..so mkdir is the right thing to do
I do always have /var on a separate partition, mostly under xfs ;)
I think I may be running into the same thing. Since upgrading my KVM server from Jaunty to Karmic occasionally the network wasn’t being brought up but an /etc/init.d/networking restart would bring it up. This is setup with a bridge doing DHCP.
same issue, i was missing all the networking.conf and networking-interfaces.conf files in the /etc/init directory, as a result running sudo service networking start or /lib/init/upstart-job networking start did not work (just said unknown job) after copying these files from another computer (ubuntu 9.10 desktop, copying to ubuntu 9.10 server (where the problem is)) the service and /lib/init/upstart-job networking start commands worked, however after boot doing an ifconfig turns up blank. i can now manually start it using either command shown above, whereas before i used to have to use /etc/init.d/networking restart.
either way i still do not get networking on boot using this fix, and my /var/run/network folder is empty always, should something be in there.
my networking.conf file now reads
————————————————————————————————–
# networking – configure virtual network devices
#
# This task causes virtual network devices that do not have an associated
# kernel object to be started on boot.
description “configure virtual network devices”
start on (local-filesystems
and stopped udevtrigger)
task
script
mkdir -p /var/run/network
exec ifup -a
end script
————————————————————————————————–
and my network-interface.conf file reads
————————————————————————————————–
# network-interface – configure network device
#
# This service causes network devices to be brought up or down as a result
# of hardware being added or removed, including that which isn’t ordinarily
# removable.
description “configure network device”
start on net-device-added
stop on net-device-removed INTERFACE=$INTERFACE
instance $INTERFACE
pre-start script
mkdir -p /var/run/network
exec ifup –allow auto $INTERFACE
end script
post-stop exec ifdown –allow auto $INTERFACE
————————————————————————————————–
i am discussing this problem on ubuntu forums, you’ll have to skip to the bottom before i start to narrow down the problem
http://ubuntuforums.org/showthread.php?p=8312309#post8312309
if you have any help it would be super appreciated
you are just missing an
auto eth0
before iface eth0 inet dhcp
That has nothing to do with the problem described here.
you don’t have any virtual interfaces…
You said, you missed all the files in /etc/init/ regarding the network configuration,
this is a totally different issue…how did you upgrade your box? via do-release-upgrade or via apt-get update ; apt-get dist-upgrade ?
I wonder if you are running into a different upgrade problem.
Regards,
\sh