Comment 14 for bug 1157435

Revision history for this message
Antonio Marra (antmarra) wrote :

I've found a small workaround.
In /etc/pm/config.d i've created a file "config" containing the following line:

SUSPEND_MODULES="alx"

Now suspend works, but NetworkManager fails to resume the last connection profile used on resume (it doesn't remember the active connection on suspend).
I've also created the file "11_alx" into /etc/pm/sleep.d with the following content:

====================================================
#!/bin/sh
PATH=/sbin:/usr/sbin:/bin:/usr/bin

case "${1}" in
    hibernate|suspend)
        CONN=$(nmcli -t --fields name conn status | uniq)
        echo -n $CONN > /var/spool/nmconn.txt ## just a temp file to store the active connection
        nmcli conn down id "$CONN"
        ;;

    resume|thaw)
        CONN=$(cat /var/spool/nmconn.txt)
        sleep 3
        nmcli conn up id "$CONN"
        ;;

esac
====================================================

but while the connection profile gets saved into /var/spool/nmconn.txt, the connection wasn't resumed on resume (but it get resumed if I execute manually those command with sudo in a terminal.