Ubuntu – Not able to suspend because of Failed to connect to non-global ctrl_ifname: (nil) error: No such file or directory

17.10suspendwpa-supplicant

I recently updated to Ubuntu 17.10 and, we I try to suspend, I have this in /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

With some investigation I saw, in /lib/systemd/system-sleep/wpasupplicant, this :

#!/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

and when I do sudo /sbin/wpa_cli suspend, I have this :

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

At this point, I don't know what to do.

I saw there is some problems to detect my wired connection in the gnome interface but it works and I can do ifconfig enp4s0. I have this result :

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

Here is my /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

And some information about my system :

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

And my network card :

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

Best Answer

  • I found the solution. I added this line at the end of /etc/network/interfaces :

    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
    

    And I added /etc/wpa_supplicant/wpa_supplicant.conf with this :

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

    I still cannot suspend but this is not related to this particular problem.