You are not logged in.

#1 2011-08-31 14:57:53

TheBigCow7
Member
From: New York, NY
Registered: 2011-08-31
Posts: 3

[Solved] Network doesn't work after hibernate?

Hello!  This is my first legit Linux install so excuse me if I'm a bit slow.  I installed Arch last night and everything went smoothly.  However, after I tested out hibernate on my machine, the network doesn't seem to work.  Just prior to the hibernate, I installed Pidgin and Skype but they worked alright, so I think that the hibernate caused a problem on eth0.

I have an Asus P8Z68-V Pro motherboard with an Intel 82579V Gigabit Ethernet Controller that's using the e1000e driver.  Running "dmesg | grep e1000e" says that it is up.

I'm not entirely clear here, but from reading, I think that I have several ways of connecting to the network, including network, dhcpcd, networkmanager, and wicd.  I am using wicd so I did the following (or at least I think I am only using wicd):

#rc.d stop network
#rc.d stop dhcpcd
#rc.d stop networkmanager

Similarly, I put a ! in front of network in rc.conf:

#
# /etc/rc.conf - Main Configuration for Arch Linux
#

# -----------------------------------------------------------------------
# LOCALIZATION
# -----------------------------------------------------------------------
#
# LOCALE: available languages can be listed with the 'locale -a' command
# DAEMON_LOCALE: If set to 'yes', use $LOCALE as the locale during daemon
# startup and during the boot process. If set to 'no', the C locale is used.
# HARDWARECLOCK: set to "", "UTC" or "localtime", any other value will result
#   in the hardware clock being left untouched (useful for virtualization)
#   Note: Using "localtime" is discouraged, using "" makes hwclock fall back
#   to the value in /var/lib/hwclock/adjfile
# TIMEZONE: timezones are found in /usr/share/zoneinfo
#   Note: if unset, the value in /etc/localtime is used unchanged
# KEYMAP: keymaps are found in /usr/share/kbd/keymaps
# CONSOLEFONT: found in /usr/share/kbd/consolefonts (only needed for non-US)
# CONSOLEMAP: found in /usr/share/kbd/consoletrans
# USECOLOR: use ANSI color sequences in startup messages
#
LOCALE="en_US.UTF-8"
DAEMON_LOCALE="no"
HARDWARECLOCK="UTC"
TIMEZONE="America/New_York"
KEYMAP="us"
CONSOLEFONT=
CONSOLEMAP=
USECOLOR="yes"

# -----------------------------------------------------------------------
# HARDWARE
# -----------------------------------------------------------------------
#
# MODULES: Modules to load at boot-up. Blacklisting is no longer supported.
#   Replace every !module by an entry as on the following line in a file in
#   /etc/modprobe.d:
#     blacklist module
#   See "man modprobe.conf" for details.
#
MODULES=()

# Udev settle timeout (default to 30)
UDEV_TIMEOUT=30

# Scan for FakeRAID (dmraid) Volumes at startup
USEDMRAID="no"

# Scan for BTRFS volumes at startup
USEBTRFS="no"

# Scan for LVM volume groups at startup, required if you use LVM
USELVM="no"

# -----------------------------------------------------------------------
# NETWORKING
# -----------------------------------------------------------------------
#
# HOSTNAME: Hostname of machine. Should also be put in /etc/hosts
#
HOSTNAME="Vicious"

# Use 'ip addr' or 'ls /sys/class/net/' to see all available interfaces.
#
# Wired network setup
#   - interface: name of device (required)
#   - address: IP address (leave blank for DHCP)
#   - netmask: subnet mask (ignored for DHCP) (optional, defaults to 255.255.255.0)
#   - broadcast: broadcast address (ignored for DHCP) (optional)
#   - gateway: default route (ignored for DHCP)
# 
# Static IP example
# interface=eth0
# address=192.168.0.2
# netmask=255.255.255.0
# broadcast=192.168.0.255
# gateway=192.168.0.1
#
# DHCP example
# interface=eth0
# address=
# netmask=
# gateway=

interface=eth0
address=
netmask=
broadcast=
gateway=

# Setting this to "yes" will skip network shutdown.
# This is required if your root device is on NFS.
NETWORK_PERSIST="no"

# Enable these netcfg profiles at boot-up. These are useful if you happen to
# need more advanced network features than the simple network service
# supports, such as multiple network configurations (ie, laptop users)
#   - set to 'menu' to present a menu during boot-up (dialog package required)
#   - prefix an entry with a ! to disable it
#
# Network profiles are found in /etc/network.d
#
# This requires the netcfg package
#
#NETWORKS=(main)

# -----------------------------------------------------------------------
# DAEMONS
# -----------------------------------------------------------------------
#
# Daemons to start at boot-up (in this order)
#   - prefix a daemon with a ! to disable it
#   - prefix a daemon with a @ to start it up in the background
#
# If something other takes care of your hardware clock (ntpd, dual-boot...)
# you should disable 'hwclock' here.
#
DAEMONS=(hwclock syslog-ng dbus !network netfs crond wicd)

Restarting eth0 through wicd-cli still did not work.  I also tried resuscitating the network via instructions on the configure network page before trying to focus solely on wicd.

I found a few similar problems on the forums by searching "wicd hibernate" and tried several solutions but they did not work.  Several problems seem to be that the network doesn't work after a suspend because I guess the stuff in RAM did not get saved?  But people were able to restart the network by running "/usr/lib/wicd/autoconnect.py" and I wasn't able to get this to work.  As a final effort, I added "resume" into mkinitcpio.conf and placed the machine into sleep again to see if it may magically reset something but of course this did not happen sad.

mkinitcpio.conf:

# vim:set ft=sh
# MODULES
# The following modules are loaded before any boot hooks are
# run.  Advanced users may wish to specify all system modules
# in this array.  For instance:
#     MODULES="piix ide_disk reiserfs"
MODULES=""

# BINARIES
# This setting includes any additional binaries a given user may
# wish into the CPIO image.  This is run first, so it may be used to
# override the actual binaries used in a given hook.
# (Existing files are NOT overwritten if already added)
# BINARIES are dependency parsed, so you may safely ignore libraries
BINARIES=""

# FILES
# This setting is similar to BINARIES above, however, files are added
# as-is and are not parsed in any way.  This is useful for config files.
# Some users may wish to include modprobe.conf for custom module options
# like so:
#    FILES="/etc/modprobe.d/modprobe.conf"
FILES=""

# HOOKS
# This is the most important setting in this file.  The HOOKS control the
# modules and scripts added to the image, and what happens at boot time.
# Order is important, and it is recommended that you do not change the
# order in which HOOKS are added.  Run 'mkinitcpio -H <hook name>' for
# help on a given hook.
# 'base' is _required_ unless you know precisely what you are doing.
# 'udev' is _required_ in order to automatically load modules
# 'filesystems' is _required_ unless you specify your fs modules in MODULES
# Examples:
##   This setup specifies all modules in the MODULES setting above.
##   No raid, lvm2, or encrypted root is needed.
#    HOOKS="base"
#
##   This setup will autodetect all modules for your system and should
##   work as a sane default
#    HOOKS="base udev autodetect pata scsi sata filesystems"
#
##   This is identical to the above, except the old ide subsystem is
##   used for IDE devices instead of the new pata subsystem.
#    HOOKS="base udev autodetect ide scsi sata filesystems"
#
##   This setup will generate a 'full' image which supports most systems.
##   No autodetection is done.
#    HOOKS="base udev pata scsi sata usb filesystems"
#
##   This setup assembles a pata mdadm array with an encrypted root FS.
##   Note: See 'mkinitcpio -H mdadm' for more information on raid devices.
#    HOOKS="base udev pata mdadm encrypt filesystems"
#
##   This setup loads an lvm2 volume group on a usb device.
#    HOOKS="base udev usb lvm2 filesystems"
HOOKS="base udev autodetect pata scsi sata resume filesystems usbinput"

# COMPRESSION
# Use this to compress the initramfs image. With kernels earlier than
# 2.6.30, only gzip is supported, which is also the default. Newer kernels
# support gzip, bzip2 and lzma. Kernels 2.6.38 and later support xz
# compression.
#COMPRESSION="gzip"
#COMPRESSION="bzip2"
#COMPRESSION="lzma"
#COMPRESSION="xz"
#COMPRESSION="lzop"

# COMPRESSION_OPTIONS
# Additional options for the compressor
#COMPRESSION_OPTIONS=""

Not sure if my fstab.conf is useful but if this has something to do with settings getting "lost" in swap, here it is.  Linux is on an SSD and HDD (sda and sdc) and Windows 7 is on a HDD (sdb).

fstab.conf:

# 
# /etc/fstab: static file system information
#
# <file system>	<dir>	<type>	<options>	<dump>	<pass>
none		/tmp	tmpfs	nodev,nosuid,noatime,size=2000M,mode=1777	0	0
/dev/sda1 / ext4 defaults,noatime,discard 0 1
/dev/sda2 /home ext4 defaults,noatime,discard 0 2
/dev/sdc1 /boot ext4 defaults 0 1
/dev/sdc2 /var ext4 defaults 0 0
/dev/sdc3 swap swap defaults 0 0
/dev/sdc4 /media/data ext4 defaults 0 0
shm /dev/shm tmpfs nodev,nosuid,size=10G 0 0

Is wicd causing these problems or did I configure something else improperly?  Would appreciate any help to get eth0 up again!

Last edited by TheBigCow7 (2011-09-13 17:57:20)

Offline

#2 2011-08-31 22:17:58

TheBigCow7
Member
From: New York, NY
Registered: 2011-08-31
Posts: 3

Re: [Solved] Network doesn't work after hibernate?

Ok, I think I've made some progress!  Hibernate definitely affects my network connection.  Could this be a kernel 3.0 problem?

I noticed that ifconfig showed eth0 without an inet addr, just an inet6 addr for the longest time.  e1000e seemed to be loading up ok.  I'm not certain here, but I think that meant the dhcp settings didn't stick, or something along those lines.

Trying to use dhcpcd like the instructions here did not work.  By some chance, one attempt did work and while it did, I downloaded and installed dhclient.  After that one successful attempt, renewing the DHCP lease via dhcpcd did not work again.

Luckily though, I found that running "dhclient eth0" worked.  My DHCP settings seemed to have somehow gotten messed up after my initial, problematic hibernate to the point where none would stick, even after a reboot.  Manually typing in "dhclient eth0" would get eth0 working, so I decided to add it to the bottom of /etc/rc.local, like in the example on the networking page.

Now, eth0 works after a boot.  However, after the daemons load up during the boot process, my computer takes a long time to get to the login prompt (this is relatively speaking, since I am on a SSD and the boot process used to be blazing fast before).  I'm pretty sure it's because I added "dhclient eth0" to /etc/rc.local.

I should say that even with these changes, after a hibernate, my eth0 still does not work and if it weren't for the edit to /etc/rc.local, eth0's inet settings would still not stick after a reboot (that is to say, the hibernate does do something to my network settings). 

Is this the correct/most efficient way to fix my DHCP problem?  Can I fix my "eth0 after hibernate" issue?  Also, can I make my DHCP settings boot up without changes to /etc/rc.local so that I can get a fast boot again (still not sure how it was able to work before without my edit)?

Offline

#3 2011-09-01 06:39:35

Deciare
Member
From: UTC -8:00
Registered: 2005-05-05
Posts: 79

Re: [Solved] Network doesn't work after hibernate?

One thing you can try is configuring Wicd to use dhclient instead of dhcpcd. That can be done from wicd-client via Preferences->External Programs. If that makes everything work, great! big_smile You can remove the call to dhclient from your /etc/rc.local, too. If it didn't work, read on.

When you resume from hibernation, scripts in /etc/pm/sleep.d/ should be automatically executed. So another way to address your post-hibernation issue would be to put a script like this in there (and make it executable):

case "$1" in
hibernate|suspend)
        ;;
thaw|resume)
        /usr/sbin/dhclient eth0
        ;;
esac

With respect to slow startup, I suspect that the explicit call to dhclient in /etc/rc.local is blocking until eth0 has an address. Try running dhclient it in the background in /etc/rc.local:

/usr/sbin/dhclient eth0 &

With all that said, I don't have any guesses as to why dhcpcd isn't working. Do you get any console output from dhcpcd eth0?

Last edited by Deciare (2011-09-01 19:45:59)

Offline

#4 2011-09-13 17:56:10

TheBigCow7
Member
From: New York, NY
Registered: 2011-08-31
Posts: 3

Re: [Solved] Network doesn't work after hibernate?

Thanks for your response and sorry for the slow reply.

I configured wicd to use dhclient and everything has been working fine.  I do not need the call in /etc/rc.local and the network seems to work after a hibernate, all through just using wicd and dhclient (did this through the wicd network manager).

I was unfortunately not able to pinpoint exactly why dhcpcd did not work, but if anyone else has a similar problem, I would suggest trying dhclient.

Offline

Board footer

Powered by FluxBB