dbus method 'Sleep' not work
<!--
Sleep:
@sleep: Indicates whether the NetworkManager daemon should sleep or wake.
Control the NetworkManager daemon's sleep state. When asleep, all
interfaces that it manages are deactivated. When awake, devices are
available to be activated. This command should not be called directly by
users or clients; it is intended for system suspend/resume tracking.
-->
<method name="Sleep">
<arg name="sleep" type="b" direction="in"/>
</method>
But the network not be deactivated after the Sleep method be called.
steps:
1.$ gdbus call --system --dest org.freedesktop.NetworkManager --object-path /org/freedesktop/NetworkManager --method org.freedesktop.NetworkManager.Sleep true
2.$ journal ctl ; # see the dbus method be called correctly.
NetworkManager[843]: <info> [1596010870.8622] manager: sleep: sleep requested (sleeping: no enabled: yes)
NetworkManager[843]: <info> [1596010870.8626] device (p2p-dev-wlp0s20f3): state change: disconnected -> unmanaged (reason 'sleeping', sys-iface-state: 'managed')
NetworkManager[843]: <info> [1596010870.8632] manager: NetworkManager state is now ASLEEP
NetworkManager[843]: <info> [1596010870.8635] audit: op="sleep-control" arg="on" pid=2825 uid=0 result="success"
- $ ping 8.8.8.8 ; # still work unexpectedly
Note: this issue can be reproduced on the latest version of network-manager source : https://git.launchpad.net/network-manager/commit/?id=6e17a2e7ad9453c0afe34dab0e6768ad8ee447c2 on Ubuntu Focal