31

Since I upgraded to Saucy Salamander 13.10, with every third suspend or so, the network is disabled and I'm unable to re-enable it. I've had to reboot to make it run again.

The network menu will have the option Enable network but clicking it will only produce a tick in the menu item, nothing else changes.

  1. How can I make it enable automatically after suspend?
  2. In the meantime, is there a workaround to at least manually re-enable it?

The PC is a Lenovo IdeaPad S205 using drivers r8169 and rt2800pci.

Braiam
  • 67,791
  • 32
  • 179
  • 269
Arild
  • 455
  • same here on Dell Studio 1550,Network controller: Intel Corporation WiFi Link 5100. After wake-up I have to perform "sudo killall NetworkManager" to work again. – Tosho Oct 21 '13 at 21:44
  • 2
    This is a confirmed bug https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/1184262 – Braiam Oct 26 '13 at 16:15
  • The bug I filed myself was marked as duplicate of that one, but actually someone unmarked it: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1243300 – Arild Nov 03 '13 at 10:49
  • Bug was fixed in Saucy/Trusty. – Braiam Mar 16 '14 at 19:14
  • I have similar problem in my DELL Inspiron N4010, I work around the problem by going to suspend and waking-up again. – PHP Learner Apr 11 '14 at 11:05

2 Answers2

25

Use:

sudo touch /etc/pm/sleep.d/network-manager-resume
sudo chmod +x /etc/pm/sleep.d/network-manager-resume
sudo nano /etc/pm/sleep.d/network-manager-resume

Paste the following and save the file. This brings NetworkManager out of suspend mode:

#!/bin/sh

# This script gets NetworkManager out of suspend.
case $1 in
     suspend|suspend_hybrid|hibernate)
    # No need to do anything here.
        ;;
     resume|thaw)
    nmcli nm sleep false
        ;;
esac

Source: https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/1184262/comments/23

asdfadsf
  • 251
  • I accepted this answer but I'm removing it now because I just had another resume without Network Manager waking up. – Arild Oct 26 '13 at 14:23
  • 1
    After making the file executable, worked for me. – pylover Oct 29 '13 at 20:41
  • Of course, that makes sense. Re-accepted answer. – Arild Nov 03 '13 at 10:40
  • 1
    Sorry for unaccepting answer again, but I'm still having the same problem. I work around it by doing sudo nmcli nm sleep false when it happens. I haven't bothered to test development sources (as suggested in response to my bug report). Right now I'm just passively hoping 14.04 will have a fix. – Arild Apr 14 '14 at 08:09
  • I think it works for me, though I can't be completely sure, as it seemed rather sporadic when the error would occur. However, I did "sudo chmod +s nmcli" first, wouldn't that be necessary for this to work (or adding sudo in the script, and a NOPASSWD for nmcli in the sudoers file)? Or does the script execute with sudo privileges regardless? – EvenLisle Oct 04 '14 at 12:54
19

I have the same issue. Looks like it's related to power management that does not wake network-manager. After resuming, you can open a terminal and type:

sudo service network-manager restart

It should bring up the network.

fbab
  • 191
  • 1
    Thanks. I just filed a bug for acpi-support, perhaps you can add to it: https://bugs.launchpad.net/ubuntu/+source/acpi-support/+bug/1243300 I'm holding off accepting your answer because someone might come up with an actual fix. – Arild Oct 22 '13 at 16:52
  • wow, after so much toiling with many script this worked for me...Thanks – danidee Nov 09 '15 at 16:41