由于无法连接到非全局 ctrl_ifname: (nil) 错误而无法暂停:没有此文件或目录

由于无法连接到非全局 ctrl_ifname: (nil) 错误而无法暂停:没有此文件或目录

我最近更新到了 Ubuntu 17.10,并且我尝试暂停,我有这个/var/log/syslog

Nov  3 03:24:29 oscar systemd[1]: Reached target Sleep.
Nov  3 03:24:29 oscar systemd[1]: Starting Suspend...
Nov  3 03:24:29 oscar systemd-sleep[9867]: Failed to connect to non-global ctrl_ifname: (nil)  error: No such file or directory
Nov  3 03:24:29 oscar systemd-sleep[9877]: /lib/systemd/system-sleep/wpasupplicant failed with error code 255.
Nov  3 03:24:29 oscar systemd-sleep[9867]: Suspending system...
Nov  3 03:25:27 oscar rsyslogd: [origin software="rsyslogd" swVersion="8.16.0" x-pid="1014" x-info="http://www.rsyslog.com"] start

经过一番调查,我发现了/lib/systemd/system-sleep/wpasupplicant这一点:

#!/bin/sh
set -e

if [ "$2" = "suspend" ] || [ "$2" = "hybrid-sleep" ]; then
    case "$1" in
        pre) /sbin/wpa_cli suspend ;;
        post) /sbin/wpa_cli resume ;;
    esac
fi

当我这样做时sudo /sbin/wpa_cli suspend,我有这个:

Failed to connect to non-global ctrl_ifname: (nil)  error: No such file or directory

此刻,我不知道该怎么办。

我发现在 gnome 界面中检测有线连接时出现了一些问题,但它可以正常工作ifconfig enp4s0。我得到了以下结果:

enp4s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
    inet 192.168.1.64  netmask 255.255.255.0  broadcast 192.168.1.255
    inet6 2001:56b:bcd5:7300:922b:34ff:fe39:b41d  prefixlen 64  scopeid 0x0<global>
    inet6 fe80::922b:34ff:fe39:b41d  prefixlen 64  scopeid 0x20<link>
    ether 90:2b:34:39:b4:1d  txqueuelen 1000  (Ethernet)
    RX packets 5144  bytes 2426774 (2.4 MB)
    RX errors 0  dropped 0  overruns 0  frame 0
    TX packets 4919  bytes 876731 (876.7 KB)
    TX errors 0  dropped 0 overruns 0  carrier 1  collisions 0

这是我的/etc/network/interfaces

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

auto enp4s0
allow-hotplug enp4s0
iface enp4s0 inet dhcp

以下是有关我的系统的一些信息:

Linux oscar 4.13.0-16-lowlatency #19-Ubuntu SMP PREEMPT Wed Oct 11 19:51:52 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

我的网卡:

04:00.0 Ethernet controller: Qualcomm Atheros AR8151 v2.0 Gigabit Ethernet (rev c0)

答案1

我找到了解决方案。我在末尾添加了这一行/etc/network/interfaces

wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

我补充/etc/wpa_supplicant/wpa_supplicant.conf说:

ctrl_interface=/var/run/wpa_supplicant
ap_scan=0
fast_reauth=0

我仍然无法暂停,但这与这个特定问题无关。

相关内容