From 0d3ed747b4c19ecd838cf5428feccb651213048c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Fri, 21 Feb 2014 18:42:12 +0100 Subject: [PATCH] suspend-prepare: call NM D-Bus interface directly nmcli doesn't seem to have stable API, especially "nmcli nm sleep" doesn't work anymore in Fedora 20. --- qubes-rpc/prepare-suspend | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/qubes-rpc/prepare-suspend b/qubes-rpc/prepare-suspend index a0c83bd..32ab8ba 100755 --- a/qubes-rpc/prepare-suspend +++ b/qubes-rpc/prepare-suspend @@ -12,7 +12,11 @@ if [ -r /rw/config/suspend-module-blacklist ]; then fi if [ x"$action" == x"suspend" ]; then - nmcli nm sleep true || service NetworkManager stop + dbus_send --system --print-reply \ + --dest=org.freedesktop.NetworkManager \ + /org/freedesktop/NetworkManager \ + org.freedesktop.NetworkManager.Sleep boolean:true || \ + service NetworkManager stop # Force interfaces down, just in case when NM didn't done it for if in `ls /sys/class/net|grep -v "lo\|vif"`; do ip l s $if down @@ -29,5 +33,9 @@ else for mod in `cat /var/run/qubes/suspend-modules-loaded`; do modprobe $mod done - nmcli nm sleep false || { [ -x /bin/systemctl ] && systemctl start NetworkManager.service; } || service qubes-core-netvm start + dbus_send --system --print-reply \ + --dest=org.freedesktop.NetworkManager \ + /org/freedesktop/NetworkManager \ + org.freedesktop.NetworkManager.Sleep boolean:false || \ + { [ -x /bin/systemctl ] && systemctl start NetworkManager.service; } || service qubes-core-netvm start fi