Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#11687 - pm-suspend not working - broken NetworkManager hook

Attached to Project: Arch Linux
Opened by David Hájek (dante4d) - Wednesday, 08 October 2008, 17:46 GMT
Last edited by Thayer Williams (thayer) - Saturday, 18 October 2008, 18:27 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Thayer Williams (thayer)
Architecture All
Severity Low
Priority Normal
Reported Version None
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

I can't suspend with pm-suspend, because NetworkManager hook fails. I easily fixed it like described here - http://wiki.archlinux.org/index.php/Pm-utils#Disabling_a_hook - but it should work out of the box if I don't have NetworkManager. So I see it as a bug.
This task depends upon

Closed by  Thayer Williams (thayer)
Saturday, 18 October 2008, 18:27 GMT
Reason for closing:  Upstream
Additional comments about closing:  Bug to be reported upstream.
Comment by Jan de Groot (JGC) - Thursday, 09 October 2008, 06:38 GMT
This error is because the dbus system bus is not running on your system. Simply disabling the hook is not the way to go, but we could make the hook have a few more checks.
Comment by David Hájek (dante4d) - Thursday, 09 October 2008, 11:03 GMT
But that's ma point - why sould I care about dbus? It's not a dependency of pm-utils plus it isn't stated anywhere that I need dbus (probably). Simply by doing 'touch /etc/pm/sleep.d/55-NetworkManager', all of sudden it works. Again - my point - why dbus, why NetworkManager? I don't use them. Ok, the hook can be there, but it shouldn't break pm-utils from working, if one doesn't use them. That's all I wanted to say.

Thanks
Comment by Thayer Williams (thayer) - Saturday, 18 October 2008, 16:14 GMT
As Jan pointed out, a global disable isn't the way to go. It would then force all NetworkManager users to remove the rule which isn't a solution either.

I'm not sure that a downstream patch is the way to go either, especially since the pm-utils developers welcome bug reports about bad hooks: "If a hook is run which you do not like or which you think is not useful or even harmful, we'd appreciate a bugreport for that."

Comment by David Hájek (dante4d) - Saturday, 18 October 2008, 18:11 GMT
#!/bin/sh
# If we are running NetworkManager, tell it we are going to sleep.
# TODO: Make NetworkManager smarter about how to handle sleep/resume
# If we are asleep for less time than it takes for TCP to reset a
# connection, and we are assigned the same IP on resume, we should
# not break established connections. Apple can do this, and it is
# rather nifty.

. "${PM_FUNCTIONS}"

command_exists dbus-send || exit $NA

suspend_nm()
{
# Tell NetworkManager to shut down networking
dbus-send --system \
--dest=org.freedesktop.NetworkManager \
/org/freedesktop/NetworkManager \
org.freedesktop.NetworkManager.sleep
}

resume_nm()
{
# Wake up NetworkManager and make it do a new connection
dbus-send --system \
--dest=org.freedesktop.NetworkManager \
/org/freedesktop/NetworkManager \
org.freedesktop.NetworkManager.wake
}

case "$1" in
hibernate|suspend)
suspend_nm
;;
thaw|resume)
resume_nm
;;
*) exit $NA
;;
esac

There's missing a check for the networkmanager itself. "command_exists networkmanager || exit $NA" added before the dbus check and all works (maybe it needs to be /etc/rc.d/networkmanager, but I don't care as long as the command isn't present :P).
Comment by David Hájek (dante4d) - Saturday, 18 October 2008, 18:18 GMT
I checked git version of pm-utils at freedesktop, the same problem is there. I will post a bug report there, so let's close this one...

Loading...