GNOME Bugzilla – Bug 330889
Hard to debug when dbus messages fail
Last modified: 2006-11-26 23:29:10 UTC
I had a situation where gnome-power-manager wasn't working because I didn't have the appropriate pam module installed, so all the dbus messages failed. However, although gnome-power-manager was printing things to stderr, these just went to /dev/null (I ended up stracing to find out what the problem was). I might be better not to actually daemonize by default so that when started by gnome-session the output will just go to ~/.xsession-errors .. Or .. perhaps gnome-power-manager should give error dialogues when the dbus messages fail.
What dbus messages failed? The ones to register org.gnome.PowerManager or the ones to HAL and NetworkManager? I think both your suggestions are valid, to not daemonize by default, and also to display a proper modal messagebox in the event of a startup failure.
It was the ones to Hal, IIRC dbus was complaining that g-p-m didn't have the correct permissions to send the event - these errors happened when g-p-m wanted to suspend the machine. I seem to recall that NetworkManager was reacting as though it was being talked to. Anyway, to reproduce my problems, just remove libpam-foreground, and re-login and then try and use g-p-m :-)
OOps. Not sure what happened with the "critical" and "high" attributes.
Created attachment 59269 [details] picture of proposed notification What do you think of the attached picture? Is this the sort of thing you had in mind?
Yeah! that looks good :-)
I've committed something to CVS to do these notifications: 2006-02-13 Richard Hughes <richard@hughsie.com> * src/gpm-common.h: Add location of FAQ page as GPM_FAQ_URL. * src/gpm-manager.c (gpm_manager_suspend, gpm_manager_hibernate): Inform the user if the HAL command failed, and point them in the direction of the online FAQ page. Fixes bug #330889. Okay, what distro you got, and what was the exact error message, and I'll add it to the FAQ page.
Excellent, thanks :-) My distro is Ubuntu dapper, and due to the daemonizing nature, the only way to get the error is to strace it, however the error is (may be minor typos, manually copied from one machine to another): WARNING **: gpm_hal_suspend: A security policy in place prevents this sender from sending this message to this recepient, see message bus configuration (rejected message had interface "org.freedesktop.Hal.Device.SystemPowerManagement" member "Suspend" error name "(unset)" destination "org.freedesktop.Hal") WARNING **: org.freedesntop.Hal.Device.SystemPowerManagement.Suspend failed (HAL error) The fix was to install the libpam-foreground package
Actually you can do --no-daemon (and even --no-daemon --verbose if you want lots of debugging text!) so that it doesn't daemonise. I've your information to the FAQ page, and I'm just waiting to upload the new pages now. Thanks, Richard.
> I've your information to the FAQ page, and I'm just waiting to upload the new > pages now. I'm having the same issue with Debian sid (unstable) because of a similar (or probably the same) dbus policy. The solution is to add the user to the powerdev group. Installing libpam-foreground didn't work for me. (adding the user eliminated the warning -- it doesn't actually doing anything, yet) Please update the FAQ :) And while you're at it, correct the 'stable/unstable? No, use etch.' in the relevant question. unstable > etch > stable (sarge). Regards, Faidon
Faidon, can you update the FAQ please? It's a wiki, so just create a new username and edit it yourself, as I'm sure you can provide more details for other debianers. Thanks, Richard.
Hi, > Faidon, can you update the FAQ please? It's a wiki, so just create a new > username and edit it yourself, as I'm sure you can provide more details for > other debianers. The popup is linking to http://www.gnome.org/projects/gnome-power-manager/faq.html which isn't a wiki, as far as I can tell. I just saw http://live.gnome.org/GnomePowerManager/Faq ...which is immutable :( I'd be happy to document my findings on the wiki, fwiw. Regards, Faidon
(In reply to comment #11) > Hi, > > Faidon, can you update the FAQ please? It's a wiki, so just create a new > > username and edit it yourself, as I'm sure you can provide more details for > > other debianers. > The popup is linking to > http://www.gnome.org/projects/gnome-power-manager/faq.html > which isn't a wiki, as far as I can tell. Aha! Gotcha. The FAQ page should be the new wiki page - I'll fix this in CVS now. > I just saw > http://live.gnome.org/GnomePowerManager/Faq > ...which is immutable :( You need to create a username and login to be able to edit. I think anonymous edits are disabled in w.g.o. Richard.
It seems the FAQ is no longer in the Wiki but in CVS... Can anybody add something about Debian and the powerdev user in the FAQ in CVS since libpam-foreground seems only valid for Ubuntu ? Thanks in advance
Oliver, if you type up a couple of paragraphs, I'll add this to the FAQ tonight. Thanks.
Something like that should fit : Why using Debian (Etch) do I get the error WARNING **: gpm_hal_suspend: A security policy in place prevents this sender from sending this message to this recepient, see message bus configuration (rejected message had interface "org.freedesktop.Hal.Device.SystemPowerManagement" member "Suspend" error name "(unset)" destination "org.freedesktop.Hal") WARNING **: org.freedesktop.Hal.Device.SystemPowerManagement.Suspend failed (HAL error) Debian ships a locked down DBUS by default for Etch which prevents ordinary users from issuing methods to HAL. To allow the current logged in user to use these methods, just add it to the powerdev group (see /usr/share/doc/gnome-power-manager/README.Debian). Hope this helps. Best regards,
2006-11-26 Richard Hughes <richard@hughsie.com> * docs/faq.html: * docs/faq.xml: * docs/index.html: Add a new FAQ from Olivier Berger about debian etch. Also remove the obsolete entries that no longer apply. Many thanks.