Summary: | On Sleep, KNetworkManager disables interfaces before pm-utils starts | ||
---|---|---|---|
Product: | knetworkmanager | Reporter: | Simon Blakely <si.blakely> |
Component: | general | Assignee: | Will Stephenson <wstephenson> |
Status: | RESOLVED UPSTREAM | ||
Severity: | normal | CC: | lamarque |
Priority: | NOR | ||
Version: | 0.9 | ||
Target Milestone: | --- | ||
Platform: | Ubuntu | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: |
Description
Simon Blakely
2011-11-12 17:54:56 UTC
Plasma NM does not trigger any action during suspend, only during resuming and none of then affects NM. Try running pm-suspend. If your problem still persists then it has nothing to do with Plasma NM or any other KDE program. By what I see in your log NM is going to sleep before triggering the dispatch scripts, that is an error in NM my oppinion. Anyway, as far as I know NM always run the dispatch scripts AFTER the event (connect or disconnect), so using /etc/NetworkManager/dispatcher.d/ does not solve your problem since you need to umount the devices BEFORE the event. PS: I think you should use a script called /etc/pm/sleep.d/54Umount, for example, for it to be executed before /usr/lib64/pm-utils/sleep.d/55NetworkManager. my pm script is 00cifs and contains #!/bin/bash case $1 in hibernate|suspend) echo "Dismounting CIFS mounts" mount ifconfig umount -f -a -t cifs ;; thaw|resume) echo "Remounting CIFS" ;; *) echo "Error State" ;; esac When I tried pm-suspend this script worked correctly, as shown in the pm-suspend.log Running hook /etc/pm/sleep.d/00cifs suspend suspend: Dismounting CIFS mounts /dev/sda10 on / type ext3 (rw,errors=remount-ro,commit=0) ... //HOME/iso on /home/simon/smb4k/HOME/iso type cifs (rw) //HOME/nntp on /home/simon/smb4k/HOME/nntp type cifs (rw) //HOME/photos on /home/simon/smb4k/HOME/photos type cifs (rw) ath0 Link encap:Ethernet HWaddr 00:19:7d:4b:37:ed inet addr:10.0.0.184 Bcast:10.0.0.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:15746 errors:0 dropped:0 overruns:0 frame:0 TX packets:6299 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:11982042 (11.9 MB) TX bytes:884537 (884.5 KB) eth0 Link encap:Ethernet HWaddr 00:16:d4:ad:37:c1 UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) Interrupt:21 Base address:0xa000 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:10 errors:0 dropped:0 overruns:0 frame:0 TX packets:10 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:500 (500.0 B) TX bytes:500 (500.0 B) wifi0 Link encap:UNSPEC HWaddr 00-19-7D-4B-37-ED-00-00-00-00-00-00-00-00-00-00 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:13289 errors:0 dropped:0 overruns:0 frame:548 TX packets:6502 errors:3 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:280 RX bytes:6983925 (6.9 MB) TX bytes:1136210 (1.1 MB) Interrupt:22 /etc/pm/sleep.d/00cifs suspend suspend: success. This clearly shows the mounted CIFS and all interfaces enabled. If I repeat the exercise using the PowerDevil panel or KDE menu I get Running hook /etc/pm/sleep.d/00cifs suspend suspend: Dismounting CIFS mounts /dev/sda10 on / type ext3 (rw,errors=remount-ro,commit=0) ... //HOME/iso on /home/simon/smb4k/HOME/iso type cifs (rw) //HOME/nntp on /home/simon/smb4k/HOME/nntp type cifs (rw) //HOME/photos on /home/simon/smb4k/HOME/photos type cifs (rw) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:470 errors:0 dropped:0 overruns:0 frame:0 TX packets:470 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:38924 (38.9 KB) TX bytes:38924 (38.9 KB) umount2: Invalid argument umount: /home/simon/smb4k/HOME/photos: not mounted No enabled interfaces, umount fails, and pm-suspend will time out on the mount points and fail the suspend after 20 seconds. KDE/PowerDevil/KNetworkManager/DBus is doing something to cause this. If you use: qdbus --system org.freedesktop.UPower /org/freedesktop/UPower \ org.freedesktop.UPower.Suspend does the problem still happen? I guess it does and the answer is because NetworkManager listens for UPower events. PowerDevil triggers the UPower sleep event, but it is NM responsability to do the right thing and it does not. I still think this is an upstream bug in NM. NM should run the dispatch scripts before sleeping. I will try to contact the NM developers about this problem. FYI: http://mail.gnome.org/archives/networkmanager-list/2011-November/msg00135.html and the upstream bug: https://bugzilla.gnome.org/show_bug.cgi?id=387832 I tried qdbus --system org.freedesktop.UPower /org/freedesktop/UPower \ org.freedesktop.UPower.Suspend As you expected, this does not work (it times out while trying to unmount the drives) One solution for your problem is bypassing Powerdevil's button events and allow acpid to handle them: . install and set acpid to start at boot. . edit the file /etc/acpi/default.sh to run pm-hibernate (suspend to disk) or pm-suspend (suspend to ram) on power button pressing. You can also set a command for lid closing event. . in Powerdevil disable all button events for all your profiles. |