You are not logged in.
Hi!
I'm using xfce 4.10 DE, and pm-utils to suspend / hibernate. No testing repo.
My problem is that dbus gets disabled too early during the suspend/hibernate process, causing a script that pauses a dbus service to be called after dbus has been stopped. So it returns an error.
I already tried to put that script as /etc/pm/sleep.d/02 - 52 - 97, hoping it could fix it.
I already talked about this problem with the developer, but he pointed his finger against my configurations. He said he tried that software with the same pm-script as mine, to pause it, on different laptops, with different distros, and i'm the only having that problem.
The software is calise-git from aur, if it can be helpful.
Has anyone of you any ideas about what's going on?
ps: i disabled all the hooks in /usr/lib/pm-utils/sleep.d by touching blank files in /etc/pm/sleep.d. But i don't think this can be the cause of the problem.
Thanks!
Offline
I'm not sure what exactly is going on, but if you don't figure it out for a dirty workaround you could make a separate script that you use to suspend. This one would first call your script to pause the service, then call pm-suspend, and then after you resume and pm-suspend has completed, it would restart the service.
Offline
Yes it is a workaround, and i'm sure it will work. But i do not want to use such a workaround only for this little thing.
I'd like to understand what is the cause of this problem...this is really weird, i think!
Offline
Well, here is my pm script:
#!/bin/sh
#
# if calise service is not capturing then prevent it from capturing just
# before hibernate/suspend, otherwise waits until capture is finished and
# then hiberantes/suspends
#
case "$1" in
hibernate|suspend)
/usr/bin/calised --pause
;;
resume|thaw)
/usr/bin/calised --resume
;;
esacand this is the error i find in my pm-suspend.log:
Running hook /usr/lib/pm-utils/sleep.d/53calised suspend suspend:
Traceback (most recent call last):
File "/usr/bin/calised", line 400, in <module>
sys.exit(main())
File "/usr/bin/calised", line 351, in main
bus = sbus()
File "/usr/lib/python2.7/site-packages/dbus/_dbus.py", line 211, in __new__
mainloop=mainloop)
File "/usr/lib/python2.7/site-packages/dbus/_dbus.py", line 100, in __new__
bus = BusConnection.__new__(subclass, bus_type, mainloop=mainloop)
File "/usr/lib/python2.7/site-packages/dbus/bus.py", line 122, in __new__
bus = cls._new_for_bus(address_or_type, mainloop=mainloop)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoServer: Failed to connect to socket /tmp/dbus-ceZl1Doh8i: Connection refusedI have dbus.service (systemd) up and running...
Offline
Debugging it better, i found out that if i run "dbus-launch" as my user, and then "sudo pm-suspend" in a terminal window, everything works pretty well.
Indeed, if i run "dbus-launch" and then close the lid/ use xfce4 button to suspend, it doesn't work (i have the same error as above).
My .xinitrc has the line "exec dbus-launch --exit-with-session startxfce4".
Tried with "exec startxfce4" alone, but nothing changed. As far as i know, the only difference between running "sudo pm-suspend" and closing the lid/clicking the exit menu -> then suspend, is only that upower attends to do its work.
Finally: why i have to manually "dbus-launch" before suspending? And where is the problem with upower (i guess there is one, but may be i'm mistaking)?
Thanks for any idea!
Offline
Ok the question is becoming more and more weird: as calise developer says:
In the end it's an Archlinux only problem (tried SLiM+XFCE/GNOME and GDM+GNOME with the same result) and so there's have something I can do to fix it.
I'm now opening a issue in sourceforge bugtracker (maybe we should ask some other Archlinux user if get the same error).
Running [calise] as root (inside or outside -tty- user session) makes pm-scripts
work fine.
The difference between running as user and running as root is that as
*user* service objects it's created inside SessionBus DBus bus, as
*root* it's created inside SystemBus DBus bus.
It seems that SessionBus gets disabled (probable policyKit rule) but
SystemBus remains alive.
Yes, in the end, he is facing this problem too, but only on archlinux. So, why is this happening? Only if running any dbus suspend command. Pm-suspend seems to work perfectly indeed (run from a terminal window, without any dbus call).
Last edited by nierro (2012-07-01 13:42:49)
Offline