After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 748531 - StateChanged signal NM_STATE_DISCONNECTING not emitted on suspend
StateChanged signal NM_STATE_DISCONNECTING not emitted on suspend
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: general
1.0.x
Other Linux
: Normal normal
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2015-04-27 14:59 UTC by account
Modified: 2016-05-13 12:47 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description account 2015-04-27 14:59:29 UTC
NetworkManager doesn't seem to emitted the StateChanged NM_STATE_DISCONNECTING signal when the system is put to suspend. Instead it just sends the NM_STATE_ASLEEP signal after disconnecting all network devices.
This causes troubles for programs like Pidgin, because they depend on the NM_STATE_DISCONNECTING signal to cleanly disconnect themselves from remote servers.
Also dispatcher scripts in pre-down.d aren't run when suspending the computer.

I am sure if that is a bug, but I think NetworkManager should emit the NM_STATE_DISCONNECTING signal to give programs and the dispatcher a chance to react on the changing network situation.
  
--- how to reproduce ----
# Debian 8.0 Jessie
$ NetworkManager -V
0.9.10.0

# Normal disconnect
$  nmcli device disconnect wlan0
## Listen for StateChanged Signals
$ dbus-monitor --system 'type='signal',sender=org.freedesktop.NetworkManager,path=/org/freedesktop/NetworkManager, member=StateChanged'

signal sender=:1.5 -> dest=(null destination) serial=1335 path=/org/freedesktop/NetworkManager; interface=org.freedesktop.NetworkManager; member=StateChanged
   uint32 30
signal sender=:1.5 -> dest=(null destination) serial=1368 path=/org/freedesktop/NetworkManager; interface=org.freedesktop.NetworkManager; member=StateChanged
   uint32 20
# NM_STATE_DISCONNECTING, NM_STATE_DISCONNECTED are emitted

# Suspend
$ systemctl suspend
$ dbus-monitor --system 'type='signal',sender=org.freedesktop.NetworkManager,path=/org/freedesktop/NetworkManager, member=StateChanged'

signal sender=:1.5 -> dest=(null destination) serial=1573 path=/org/freedesktop/NetworkManager; interface=org.freedesktop.NetworkManager; member=StateChanged
   uint32 10
# only NM_STATE_ASLEEP emitted


References:
Pidgin doesn't disconnect on suspend Debian bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=765892
Comment 1 account 2015-05-03 11:23:54 UTC
Tested it again same for:
# Debian Testing
$ NetworkManager -V
1.0.0
Comment 2 Orion Poplawski 2016-04-26 17:37:17 UTC
This is a critical issue for me as well - we need to unmount NFS filesystems before going to sleep via pre-down scripts.
Comment 3 Orion Poplawski 2016-04-26 17:42:16 UTC
Other downstream reports:

F22: https://bugzilla.redhat.com/show_bug.cgi?id=1238865
RHEL7: https://bugzilla.redhat.com/show_bug.cgi?id=1330694
Comment 4 Beniamino Galvani 2016-05-13 12:47:33 UTC
Branch bg/disconnect-on-suspend-rh1330694-v2 merged to master:

https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=3fdffab9550bf7e55815d7a4453854057de55f0a

(see also https://bugzilla.redhat.com/show_bug.cgi?id=1330694 )