在 Ubuntu 14.04 中恢复后无线网络无法正常工作

Oss*_*ser 79 suspend wireless networking atheros 14.04

[更新]:
同样的问题在Kubuntu中存在,以同样的方式解决。
[已解决]:
通过应用以下命令,nmcli nm我得到了以下信息:

暂停前

RUNNING         STATE           WIFI-HARDWARE   WIFI       WWAN-HARDWARE   WWAN      
running         connected       enabled         enabled    enabled         enabled  
Run Code Online (Sandbox Code Playgroud)

您可以看到状态已连接,其余状态已启用并正在运行

暂停后

RUNNING         STATE           WIFI-HARDWARE   WIFI       WWAN-HARDWARE   WWAN      
running         asleep          enabled         enabled    enabled         disabled
Run Code Online (Sandbox Code Playgroud)

正如你所看到的状态是睡着了,这意味着我们亲爱的网络管理员仍在打盹,所以要解决使用休闲命令行:
sudo nmcli nm sleep false
这告诉网络管理员唤醒地狱。使其永久化:
创建一个/etc/pm/sleep.d包含以下内容的脚本(不要忘记将脚本标记为可执行文件):

#!/bin/sh

case "${1}" in
        resume|thaw)
        nmcli nm sleep false
                ;;
esac
Run Code Online (Sandbox Code Playgroud)

多亏这个

原来的问题:

我刚刚下载了 Ubuntu 14.04 并安装在我的笔记本电脑上:ASUS X61SL 和 Intel P8400 Core2Duo x64 处理器。
当我合上盖子时,系统暂停,但是当我再次打开盖子并恢复时,无线网络未激活(整个网络被禁用),当我选择“启用网络”时,没有任何反应。
这是有关我的无线适配器的信息:

$ lspci | grep -i wireless
02:00.0 Network controller: Qualcomm Atheros AR928X Wireless Network Adapter (PCI-Express) (rev 01)  
Run Code Online (Sandbox Code Playgroud)

这个问题在 Ubuntu 13.04、Linux Mint Debian Edition 或 Debian 7 wheezy(GNOME 或 KDE)中不存在。

编辑:很少有测试结果如下:
问题影响我的无线和有线网络。
注意:我需要pci=nomsi将这一行添加到 grub 中才能启动。
当手动注销然后挂起然后恢复然后登录时,一切正常。
在登录时直接挂起时会发生问题。
锁定和挂起会导致与直接挂起相同的问题。
这个问题似乎也会影响注销功能:如果您从统一面板的用户菜单中选择注销,那么您就不会注销,但如果您使用命令行,gnome-session-quit --logout则可以注销。
现在lshw -C network输出:
正常(功能齐全的网络):

  *-network               
       description: Ethernet interface
       product: 191 Gigabit Ethernet Adapter
       vendor: Silicon Integrated Systems [SiS]
       physical id: 4
       bus info: pci@0000:00:04.0
       logical name: eth0
       version: 02
       serial: 00:24:8c:1e:f8:53
       size: 10Mbit/s
       capacity: 100Mbit/s
       width: 32 bits
       clock: 33MHz
       capabilities: pm bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=sis190 driverversion=1.4 duplex=half latency=0 link=no multicast=yes port=MII speed=10Mbit/s
       resources: irq:19 memory:fddfcc00-fddfcc7f ioport:cc00(size=128)
  *-network
       description: Wireless interface
       product: AR928X Wireless Network Adapter (PCI-Express)
       vendor: Qualcomm Atheros
       physical id: 0
       bus info: pci@0000:02:00.0
       logical name: wlan0
       version: 01
       serial: 00:15:af:e2:13:db
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress msix bus_master cap_list ethernet physical wireless
       configuration: broadcast=yes driver=ath9k driverversion=3.13.0-24-generic firmware=N/A ip=6.6.6.8 latency=0 link=yes multicast=yes wireless=IEEE 802.11bgn
       resources: irq:16 memory:fdff0000-fdffffff
Run Code Online (Sandbox Code Playgroud)

恢复后(“/etc/pm/config.d”不包含“unload_modules”):

 *-network DISABLED      
       description: Ethernet interface
       product: 191 Gigabit Ethernet Adapter
       vendor: Silicon Integrated Systems [SiS]
       physical id: 4
       bus info: pci@0000:00:04.0
       logical name: eth0
       version: 02
       serial: 00:24:8c:1e:f8:53
       size: 10Mbit/s
       capacity: 100Mbit/s
       width: 32 bits
       clock: 33MHz
       capabilities: pm bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=sis190 driverversion=1.4 duplex=half latency=0 link=no multicast=yes port=MII speed=10Mbit/s
       resources: irq:19 memory:fddfcc00-fddfcc7f ioport:cc00(size=128)
  *-network DISABLED
       description: Wireless interface
       product: AR928X Wireless Network Adapter (PCI-Express)
       vendor: Qualcomm Atheros
       physical id: 0
       bus info: pci@0000:02:00.0
       logical name: wlan0
       version: 01
       serial: 00:15:af:e2:13:db
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress msix bus_master cap_list ethernet physical wireless
       configuration: broadcast=yes driver=ath9k driverversion=3.13.0-24-generic firmware=N/A latency=0 link=no multicast=yes wireless=IEEE 802.11bgn
       resources: irq:16 memory:fdff0000-fdffffff
Run Code Online (Sandbox Code Playgroud)

当我按照此处的建议将文件 unload_modules 添加到目录“/etc/pm/config.d”时,注销后,暂停,恢复然后登录网络工作正常,但我无法连接到我的无线网络。
再次lshw -C network 恢复后的结果(“/etc/pm/config.d”包含“unload_modules”):

 *-network DISABLED      
       description: Ethernet interface
       product: 191 Gigabit Ethernet Adapter
       vendor: Silicon Integrated Systems [SiS]
       physical id: 4
       bus info: pci@0000:00:04.0
       logical name: eth0
       version: 02
       serial: 00:24:8c:1e:f8:53
       size: 10Mbit/s
       capacity: 100Mbit/s
       width: 32 bits
       clock: 33MHz
       capabilities: pm bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=sis190 driverversion=1.4 duplex=half latency=0 link=no multicast=yes port=MII speed=10Mbit/s
       resources: irq:19 memory:fddfcc00-fddfcc7f ioport:cc00(size=128)
  *-network DISABLED
       description: Wireless interface
       product: AR928X Wireless Network Adapter (PCI-Express)
       vendor: Qualcomm Atheros
       physical id: 0
       bus info: pci@0000:02:00.0
       logical name: wlan0
       version: 01
       serial: 00:15:af:e2:13:db
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress msix bus_master cap_list ethernet physical wireless
       configuration: broadcast=yes driver=ath9k driverversion=3.13.0-24-generic firmware=N/A latency=0 link=no multicast=yes wireless=IEEE 802.11bgn
       resources: irq:16 memory:fdff0000-fdffffff
Run Code Online (Sandbox Code Playgroud)

'unload_modules' 的内容,其中:

SUSPEND_MODULES="$SUSPEND_MODULES ath9k"
SUSPEND_MODULES="$SUSPEND_MODULES sis190"
Run Code Online (Sandbox Code Playgroud)

其中“ath9k”是我的无线模块,“sis190”是我的以太网模块。

Owa*_*one 27

以上答案在 14.10 上对我不起作用。经过一番反复试验,我最终得到了这个,

#!/bin/sh

case "${1}" in
  resume|thaw)
    nmcli r wifi off && nmcli r wifi on ;;
esac
Run Code Online (Sandbox Code Playgroud)

/etc/pm/sleep.d/10_resume_wifi
它放在使它可执行中sudo chmod 755 /etc/pm/sleep.d/10_resume_wifi ,问题应该立即得到解决。

  • 'r' 是什么意思?我收到“错误:对象‘r’未知。” 这似乎对我有用:“nmcli nm wifi on;” (ubuntu 14.04 - 戴尔精密笔记本电脑) (2认同)

小智 21

我有一个解决方案,但它只是为了重新启动您的网络管理器。

sudo service network-manager restart
Run Code Online (Sandbox Code Playgroud)

这不是永久的解决方案。

  • 在 Ubuntu 16.10 上为我工作。然而,显然 /etc/pm/sleep.d 不再使用。我把它放在 /lib/systemd/system-sleep 中,如:#!/bin/sh case $1 in post) service network-manager restart ;; esac (2认同)

Aug*_*ger 4

最终对我有用的脚本:

$ cat /etc/pm/sleep.d/10_resume_wifi 
#!/bin/sh

case "${1}" in
  resume|thaw) nmcli nm sleep false ;;
esac

$ ll /etc/pm/sleep.d/10_resume_wifi
-rwxr-xr-x 1 root root 70 mars  31 09:09 /etc/pm/sleep.d/10_resume_wifi
Run Code Online (Sandbox Code Playgroud)

另一个答案有拼写错误(我知道它们可以修复),但无论如何都对我不起作用。


Mic*_*ael -3

您是否尝试过制作另一个像这样的脚本在 kate 中输入:

#/bin/sh

    case ![1] in
        ./bin/sh
        network="true"
        nmcli nm -c sleep=false -network
    endasc
Run Code Online (Sandbox Code Playgroud)

并将其保存为 /etc/network 中的 jsin7 文件,并将其命名为 network.d,这可能会正常工作。

  • 这是要做什么?什么是“![$]”?为什么是`./bin/sh`?你在`/etc/network`中,那里不会有`./bin/sh`。什么是“jsin7”文件?Case 语句以“esac”结尾,而不是“easc”。他们还需要一个变量和一个条件。 (3认同)