Page 1 of 1

System standby on queue finish Ubuntu Lucid

Posted: May 16th, 2010, 4:02 am
by Dufu
Hi,

I'm trying to let SABnzbd put my system to standby when the download queue is empty, but it's not working.

I found this in the logs:

Code: Select all

Exception in thread Thread-34:
Traceback (most recent call last):
  File "/usr/lib/python2.6/threading.py", line 532, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.6/threading.py", line 484, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/local/src/SABnzbd/sabnzbd/__init__.py", line 538, in system_standby
    misc.linux_standby()
  File "/usr/local/src/SABnzbd/sabnzbd/misc.py", line 1240, in linux_standby
    if proxy.Get(interface, 'can-suspend', dbus_interface=pinterface):
AttributeError: 'NoneType' object has no attribute 'Get'
Python-dbus is installed. Any know how to get this working?

Thanks.

Edit:
To clarify, I'm not using the Ubuntu package. I'm running straight from source (0.5.2). (this topic seemed to be moved to the ubuntu/debian package subforum)

Re: System standby on queue finish Ubuntu Lucid

Posted: May 16th, 2010, 8:50 am
by jcfp
Might want to make sure dbus itself is actually installed too, other than that no idea.

Re: System standby on queue finish Ubuntu Lucid

Posted: May 16th, 2010, 2:01 pm
by Dufu
Dbus itself is installed. Might have something to do with Lucid using UPower?

Re: System standby on queue finish Ubuntu Lucid

Posted: May 17th, 2010, 5:05 am
by monty0815
That would appear to be the problem, the code as it is now can not work on lucid as devicekit is deprecated und upower used instead.

Re: System standby on queue finish Ubuntu Lucid

Posted: May 17th, 2010, 5:29 am
by shypike
Our response will probably be to remove power management support for Unix/Linux altogether.
Instead people will need to have an end-of-queue user script.

Re: System standby on queue finish Ubuntu Lucid

Posted: May 17th, 2010, 8:00 am
by Dufu
I guess it'll be a user script then.

Re: System standby on queue finish Ubuntu Lucid

Posted: May 17th, 2010, 8:18 am
by monty0815
This works for me:

Code: Select all

#!/usr/bin/python
# -*- coding: utf-8 -*-
import dbus
bus = dbus.SystemBus()
proxy = bus.get_object('org.freedesktop.UPower', '/org/freedesktop/UPower')
iface = dbus.Interface(proxy, 'org.freedesktop.UPower')
iface.Suspend()

Re: System standby on queue finish Ubuntu Lucid

Posted: May 17th, 2010, 9:25 am
by shypike
Good content for a user script.
SABnzbd is agnostic regarding the actual Unix/Linux distribution and specific configuration.
Given that, we should never have implemented a specific power management solution.
The Windows and OSX variants will keep support because power management is fairly consistent across their releases.

Re: System standby on queue finish Ubuntu Lucid

Posted: June 17th, 2010, 4:16 pm
by Zignut
I solved the problem this way: http://forums.sabnzbd.org/index.php?topic=4565.0

-Zignut