Interfaces do not get assigned IP addresses on boot

Bug #105236 reported by Sebastian Keller
4
Affects Status Importance Assigned to Milestone
netbase (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: netbase

netbase: 4.27ubuntu2
ifupdown: 0.6.8ubuntu6
net-tools: 1.60-17ubuntu1

Problem description;
eth0 does not get assigned IP on boot (static configuration).

Whats causing it:
I tracked the problem down to "eth0=eth0" being present in /var/run/network/ifstate which causes ifup to think eth0 is already up.
If i run "ifdown eth0" before rebooting, eth0 gets an ip on the next boot. (ifup is called in /etc/init.d/networking start)

How to solve:
/var/run/network/ifstate should be emptied before calling ifup in /etc/init.d/networking start
or;
make sure /etc/init.d/networking stop is called on shutdown (but in case of a reset you will still have the line present in /var/run/network/ifstate so that solution is not as good as the first)

Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

/var/run should be a temporary filesystem

Could you provide the output of "ls /etc/rcS.d" for me

Revision history for this message
Sebastian Keller (skeller) wrote :
Download full text (3.7 KiB)

sebastian@desktop:~$ ls -l /etc/rcS.d/
total 4
-rw-r--r-- 1 root root 785 2007-04-10 23:45 README
lrwxrwxrwx 1 root root 24 2006-11-18 21:55 S01mountkernfs.sh -> ../init.d/mountkernfs.sh
lrwxrwxrwx 1 root root 19 2006-11-18 22:16 S01readahead -> ../init.d/readahead
lrwxrwxrwx 1 root root 14 2005-04-28 22:32 S04udev -> ../init.d/udev
lrwxrwxrwx 1 root root 18 2005-04-28 22:31 S05bootlogd -> ../init.d/bootlogd
lrwxrwxrwx 1 root root 24 2006-11-30 03:46 S06keyboard-setup -> ../init.d/keyboard-setup
lrwxrwxrwx 1 root root 41 2006-11-18 20:55 S07linux-restricted-modules-common -> ../init.d/linux-restricted-modules-common
lrwxrwxrwx 1 root root 18 2006-11-18 22:07 S08loopback -> ../init.d/loopback
lrwxrwxrwx 1 root root 22 2005-04-28 22:31 S10checkroot.sh -> ../init.d/checkroot.sh
lrwxrwxrwx 1 root root 26 2006-11-18 21:55 S11mountdevsubfs.sh -> ../init.d/mountdevsubfs.sh
lrwxrwxrwx 1 root root 21 2007-02-03 06:09 S13pcmciautils -> ../init.d/pcmciautils
lrwxrwxrwx 1 root root 19 2006-11-18 22:08 S17procps.sh -> ../init.d/procps.sh
lrwxrwxrwx 1 root root 27 2005-04-28 22:32 S20module-init-tools -> ../init.d/module-init-tools
lrwxrwxrwx 1 root root 17 2006-11-18 21:55 S22mtab.sh -> ../init.d/mtab.sh
lrwxrwxrwx 1 root root 16 2007-03-10 02:50 S25brltty -> ../init.d/brltty
lrwxrwxrwx 1 root root 20 2006-11-18 22:06 S25mdadm-raid -> ../init.d/mdadm-raid
lrwxrwxrwx 1 root root 20 2005-04-28 22:31 S30checkfs.sh -> ../init.d/checkfs.sh
lrwxrwxrwx 1 root root 21 2005-04-28 22:31 S35mountall.sh -> ../init.d/mountall.sh
lrwxrwxrwx 1 root root 31 2006-11-18 21:55 S36mountall-bootclean.sh -> ../init.d/mountall-bootclean.sh
lrwxrwxrwx 1 root root 19 2005-04-28 22:32 S36udev-mtab -> ../init.d/udev-mtab
lrwxrwxrwx 1 root root 27 2006-11-18 22:16 S39readahead-desktop -> ../init.d/readahead-desktop
lrwxrwxrwx 1 root root 21 2005-04-28 22:31 S40hostname.sh -> ../init.d/hostname.sh
lrwxrwxrwx 1 root root 20 2007-04-08 21:07 S40networking -> ../init.d/networking
lrwxrwxrwx 1 root root 21 2005-04-28 22:31 S45mountnfs.sh -> ../init.d/mountnfs.sh
lrwxrwxrwx 1 root root 20 2006-11-18 21:55 S45waitnfs.sh -> ../init.d/waitnfs.sh
lrwxrwxrwx 1 root root 31 2006-11-18 21:55 S46mountnfs-bootclean.sh -> ../init.d/mountnfs-bootclean.sh
lrwxrwxrwx 1 root root 20 2006-11-18 22:17 S47lm-sensors -> ../init.d/lm-sensors
lrwxrwxrwx 1 root root 23 2006-11-30 03:46 S49console-setup -> ../init.d/console-setup
lrwxrwxrwx 1 root root 20 2007-03-12 20:14 S50hwclock.sh -> ../init.d/hwclock.sh
lrwxrwxrwx 1 root root 21 2005-04-28 22:31 S55bootmisc.sh -> ../init.d/bootmisc.sh
lrwxrwxrwx 1 root root 18 2006-11-18 23:02 S55pppd-dns -> ../init.d/pppd-dns
lrwxrwxrwx 1 root root 17 2005-04-28 22:31 S55urandom -> ../init.d/urandom
lrwxrwxrwx 1 root root 16 2006-11-18 22:07 S70screen -> ../init.d/screen
lrwxrwxrwx 1 root root 20 2006-11-18 20:42 S70x11-common -> ../init.d/x11-common
lrwxrwxrwx 1 root root 27 2006-11-18 22:17 S90console-screen.sh -> ../init.d/console-screen.sh

sebastian@desktop:~$ mount
/dev/hdc9 on / type ext2 (rw,errors=remount-ro)
/dev/bus/usb on /proc/bus/usb type none (rw,bind)
proc on /proc type proc (rw,noexec,nosuid,nodev)
/sys on /sys type sy...

Read more...

Revision history for this message
Sebastian Keller (skeller) wrote :

Fixed it.

Here is what I did:
init 1
rm -r /var/run/*
rm -r /var/lock/*
umount /var/run
umount /var/lock
rm -r /var/run/*
rm -r /var/lock/*
umount /var
rm -r /var/run/*
rm -r /var/lock/*

removed the /dev/shm line in /etc/fstab (since it is mounted by an init-script now)

reboot

just in case someone has similar problems: make sure you have /var/run and /var/lock on your / partition (umount var before)

Revision history for this message
John Covici (covici) wrote :

The problem with this method is that it deletes the directories under /var/run
which may be necessary. A better solution would be to do a find command -type f
on /var/run and /var/lock early in the boot sequence. Mainstream Debian
does this successfully, I believe.

Revision history for this message
Christian Roessner (christian-roessner-net) wrote :
Download full text (3.2 KiB)

Hi,

I am not wuiet sure, but I guess, I do have the excat same bug in gutsy-tribe 5 on 2 different machines.

I also did an init 1, umounted /var/run/var/lock, and as described above, the directories were not empty. So I deleted all the files. But on next reboot, everything was there, again.

I can not use NetworkManager (which works on my first macine as a workaround), because I use a very complex /etc/network/interfaces file:

auto lo
iface lo inet loopback

mapping eth0 # lan
        script /usr/sbin/guessnet-ifupdown
        map lan-home
        map default: default-net
        map timeout: 20
        map verbose: true

mapping eth1 # wlan
        script /usr/sbin/guessnet-ifupdown
        map wlan-home
        map wlan-home2
        map wlan-fh
        map default: default-net
        map timeout: 20
        map verbose: true

#
## lan
#
iface lan-home inet dhcp
        test1 peer address 192.168.3.1 mac 00:12:17:15:F5:CC
        post-up /etc/init.d/openvpn start licherstr
        pre-down /etc/init.d/openvpn stop licherstr

#
## wlan
#
iface wlan-home inet dhcp
        test1 wireless essid "RNS"
        pre-up /etc/init.d/wpasupplicant.init-daemon start
        post-up /etc/init.d/openvpn start licherstr
        pre-down /etc/init.d/openvpn stop licherstr
        post-down /etc/init.d/wpasupplicant.init-daemon stop

iface wlan-home2 inet dhcp
        test1 wireless essid "RNS_FSt12"
        pre-up /etc/init.d/wpasupplicant.init-daemon start
        post-up /etc/init.d/openvpn start licherstr
        pre-down /etc/init.d/openvpn stop licherstr
        post-down /etc/init.d/wpasupplicant.init-daemon stop

iface wlan-fh inet dhcp
        test1 wireless essid "FHGIFB2"
        pre-up /etc/init.d/wpasupplicant.init-daemon start
        post-up /etc/init.d/openvpn start licherstr
        pre-down /etc/init.d/openvpn stop licherstr
        post-down /etc/init.d/wpasupplicant.init-daemon stop

#
## Default
#
iface default-net inet dhcp
        pre-up /etc/init.d/wpasupplicant.init-daemon start
        post-up /etc/init.d/openvpn start licherstr
        pre-down /etc/init.d/openvpn stop licherstr
        post-down /etc/init.d/wpasupplicant.init-daemon stop

The file wpasupplicant.init-daemon is taken from /usr/share/doc/wpasupplicant/examples and modified for my device eth1.

Everytime after having logged into gnome session, I have to open a terminal and run ifup eth1 (Running ifdown eth1 before, I get the information: Device has not been configured, yet. Or similar message).

Important: The exactly same setup was working absolutely fine under Feisty. So this is a Gutsy bug.

What I tested:

cd /etc
mv initramfs-tools initramfs-tools-old
dpkg --force-depends -P initramfs-tools
aptitude install initramfs-tools
Removing the -old folder
Rebooted

Because mountkernfs.sh is in rcS.d as S01, I guess the problem is created in the initrd.

drwxr-xr-x 2 root root 4096 2007-09-27 19:34 .
drwxr-xr-x 140 root root 12288 2007-09-28 11:19 ..
-rw-r--r-- 1 root root 785 2007-09-21 09:11 README
lrwxrwxrwx 1 root root 24 2007-02-27 17:12 S01mountkernfs.sh -> ../init.d/mountkernfs.sh
[...]
lrwxrwxrwx 1 root root 20 2007-02-27 17:12 S40networking ...

Read more...

Revision history for this message
John Covici (covici) wrote : [Bug 105236] Re: Intefraces do not get assigned IP-addresses on boot
Download full text (4.0 KiB)

So why are you sending me this message?
I have never seen this bug before.

on Friday 09/28/2007 Christian Roessner(<email address hidden>) wrote
 > Hi,
 >
 > I am not wuiet sure, but I guess, I do have the excat same bug in gutsy-
 > tribe 5 on 2 different machines.
 >
 > I also did an init 1, umounted /var/run/var/lock, and as described
 > above, the directories were not empty. So I deleted all the files. But
 > on next reboot, everything was there, again.
 >
 > I can not use NetworkManager (which works on my first macine as a
 > workaround), because I use a very complex /etc/network/interfaces file:
 >
 > auto lo
 > iface lo inet loopback
 >
 > mapping eth0 # lan
 > script /usr/sbin/guessnet-ifupdown
 > map lan-home
 > map default: default-net
 > map timeout: 20
 > map verbose: true
 >
 > mapping eth1 # wlan
 > script /usr/sbin/guessnet-ifupdown
 > map wlan-home
 > map wlan-home2
 > map wlan-fh
 > map default: default-net
 > map timeout: 20
 > map verbose: true
 >
 > #
 > ## lan
 > #
 > iface lan-home inet dhcp
 > test1 peer address 192.168.3.1 mac 00:12:17:15:F5:CC
 > post-up /etc/init.d/openvpn start licherstr
 > pre-down /etc/init.d/openvpn stop licherstr
 >
 > #
 > ## wlan
 > #
 > iface wlan-home inet dhcp
 > test1 wireless essid "RNS"
 > pre-up /etc/init.d/wpasupplicant.init-daemon start
 > post-up /etc/init.d/openvpn start licherstr
 > pre-down /etc/init.d/openvpn stop licherstr
 > post-down /etc/init.d/wpasupplicant.init-daemon stop
 >
 > iface wlan-home2 inet dhcp
 > test1 wireless essid "RNS_FSt12"
 > pre-up /etc/init.d/wpasupplicant.init-daemon start
 > post-up /etc/init.d/openvpn start licherstr
 > pre-down /etc/init.d/openvpn stop licherstr
 > post-down /etc/init.d/wpasupplicant.init-daemon stop
 >
 > iface wlan-fh inet dhcp
 > test1 wireless essid "FHGIFB2"
 > pre-up /etc/init.d/wpasupplicant.init-daemon start
 > post-up /etc/init.d/openvpn start licherstr
 > pre-down /etc/init.d/openvpn stop licherstr
 > post-down /etc/init.d/wpasupplicant.init-daemon stop
 >
 > #
 > ## Default
 > #
 > iface default-net inet dhcp
 > pre-up /etc/init.d/wpasupplicant.init-daemon start
 > post-up /etc/init.d/openvpn start licherstr
 > pre-down /etc/init.d/openvpn stop licherstr
 > post-down /etc/init.d/wpasupplicant.init-daemon stop
 >
 > The file wpasupplicant.init-daemon is taken from
 > /usr/share/doc/wpasupplicant/examples and modified for my device eth1.
 >
 > Everytime after having logged into gnome session, I have to open a
 > terminal and run ifup eth1 (Running ifdown eth1 before, I get the
 > information: Device has not been configured, yet. Or similar message).
 >
 > Important: The exactly same setup was working absolutely fine under
 > Feisty. So this is a Gutsy bug.
 >
 > What I tested:
 >
 > cd /etc
 > mv initramfs-tools initramfs-tools-old
 > dpkg --force-depends -P initramfs-tools
 > aptitude install initramfs-tools
 > Removing the -old folder
...

Read more...

Revision history for this message
Christian Roessner (christian-roessner-net) wrote : Re: Intefraces do not get assigned IP-addresses on boot

Well, I feel sorry, if it was wrong. I did not make a difference between an assigned address or something else in the interfaces file. All what you described here, was the same with my problem, even when I right now fixed it.

In my case, it was ifplugd.

I wanted to prevent a duplicate bug report. But maybe I was wrong

Revision history for this message
Daniel T Chen (crimsun) wrote :

Is this symptom still reproducible in 8.10 beta?

Changed in netbase:
status: New → Incomplete
Revision history for this message
Sebastian Keller (skeller) wrote :

I think this can be marked invalid as I guess the original problem was caused by skipping a few versions when upgrading from hardy.

Changed in netbase:
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.