Page 5 of 6

Re: [Plugin] Autoshutdown - Shutdown PC once torrents comple

Posted: Sat Nov 28, 2015 12:19 am
by Cas
Are you using the latest version?

Re: [Plugin] Autoshutdown - Shutdown PC once torrents comple

Posted: Sat Nov 28, 2015 3:31 am
by ifahmyy
Yew I'm using the leatest version of deluge and the.7.egg in first page as I said in previous reply I managed to run deluge from terminal after I stop writable I only face that error which not allow pc to shutdown

Re: [Plugin] Autoshutdown - Shutdown PC once torrents comple

Posted: Sat Nov 28, 2015 3:36 am
by ifahmyy
Also to be sure where's the leatest version?

Re: [Plugin] Autoshutdown - Shutdown PC once torrents comple

Posted: Sat Nov 28, 2015 3:45 am
by ifahmyy

Code: Select all

[ERROR   ] 05:43:23 eventmanager:59 Event handler TorrentFinishedEvent failed in <bound method Core.on_event_torrent_finished of <autoshutdown.core.Core object at 0x7efce4161ad0>> with exception org.freedesktop.DBus.Error.AccessDenied: Rejected send message, 2 matched rules; type="method_call", sender=":1.190" (uid=1000 pid=10616 comm="/usr/bin/python /usr/bin/deluge ") interface="org.freedesktop.login1" member="Shutdown" error name="(unset)" requested_reply="0" destination=":1.4" (uid=0 pid=919 comm="/lib/systemd/systemd-logind ")



using AutoShutdown-1.3-py2.7.egg :( still same problem im sick of it i really like deluge but i can offer 24/h electric bills :(

Re: [Plugin] Autoshutdown - Shutdown PC once torrents comple

Posted: Sat Nov 28, 2015 12:36 pm
by Cas
I have already responded to someone else with that same error already: http://forum.deluge-torrent.org/viewtop ... 30#p219893

Specifically what version of Ubuntu are you using: `lsb_release -d`

The problem here is that Ubuntu has changed the method to shutdown with what appears to be permission issues for the new method however I am seeing no such issues on my system. Can you verify these dbus commands works for you: http://askubuntu.com/a/454077/8570

Re: [Plugin] Autoshutdown - Shutdown PC once torrents comple

Posted: Sat Nov 28, 2015 2:10 pm
by Cas
Found and fixed an issue with dbus and login1, so there is a new 1.4 release: https://github.com/cas--/autoshutdown/releases

Re: [Plugin] Autoshutdown - Shutdown PC once torrents complete

Posted: Sun Aug 14, 2016 4:27 pm
by mhertz
On Arch linux you need to install python2-dbus for being able to enable the plugin and get it's preferences page to show up. Just a heads-up :)

Re: [Plugin] Autoshutdown - Shutdown PC once torrents complete

Posted: Fri Aug 26, 2016 1:49 am
by mhertz
Could I please ask for a feature-request of getting added also auto-exit'ing of deluge after all downloads finish(but not PC, just delluge(d)).

I very cruedly hacked this plugin to only have one always-on functionality of doing this by replacing the self.power_action() function call with instead:

Code: Select all

import os
os.system("sleep 10 && pkill -9 deluge*")
No python experience whatsoever as you can clearly see :) It works, except it even with the sleep added, still kills deluge* processes before even deluge-console has stated download finished.

I don't need this myself as already have made a bash-script doing this(by just grep'ing 'deluge-console info' every 30 secs and pkill'ing deluged) but I would like the possibility of installing this plugin on other systems I support for family-members e.g. using windows. This is the only functionality I can think off that deluge doesn't support, and is an often available function in other clients like e.g. qbittorrent and utorrent etc.

Re: [Plugin] Autoshutdown - Shutdown PC once torrents complete

Posted: Fri Mar 03, 2017 11:19 am
by ted70
Debian 8
Deluge 1.3.13
libtorrent: 1.1.1.0

Not working.

But the team:

Code: Select all

ted70@server:~$ dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1 "org.freedesktop.login1.Manager.PowerOff" boolean:true
working fine

what could be the problem?

log:
[ERROR ] 14:09:45 eventmanager:59 Event handler TorrentFinishedEvent failed in <bound method Core.on_event_torrent_finished of <autoshutdown.core.Core object at 0x7fa55401f210>> with exception org.freedesktop.DBus.Error.AccessDenied: Rejected send message, 2 matched rules; type="method_call", sender=":1.2" (uid=1000 pid=801 comm="/usr/bin/python /usr/bin/deluged -d -l /home/ted70/") interface="org.freedesktop.login1.Manager" member="Shutdown" error name="(unset)" requested_reply="0" destination=":1.1" (uid=0 pid=809 comm="/lib/systemd/systemd-logind ")

Code: Select all

dpkg -l | grep dbus
ii  dbus                                 1.8.22-0+deb8u1                      amd64        simple interprocess messaging system (daemon and utilities)
ii  libdbus-1-3:amd64                    1.8.22-0+deb8u1                      amd64        simple interprocess messaging system (library)
ii  libdbus-glib-1-2:amd64               0.102-1                              amd64        simple interprocess messaging system (GLib-based shared library)
ii  libqt4-dbus:amd64                    4:4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1 amd64        Qt 4 D-Bus module
ii  libqt5dbus5:amd64                    5.3.2+dfsg-4+deb8u2                  amd64        Qt 5 D-Bus module
ii  libqtdbus4:amd64                     4:4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1 amd64        Qt 4 D-Bus module library
ii  python-dbus                          1.2.0-2+b3                           amd64        simple interprocess messaging system (Python interface)
ii  python-dbus-dev                      1.2.0-2                              all          main loop integration development files for python-dbus
ii  qdbus                                4:4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1 amd64        Qt 4 D-Bus tool

Code: Select all

cat /etc/polkit-1/localauthority/50-local.d/deluge-actions.pkla 
[Actions for my user]
Identity=unix-user:ted70
Action=org.freedesktop.login1.*
ResultAny=yes
ResultInactive=no
ResultActive=yes

Re: [Plugin] Autoshutdown - Shutdown PC once torrents complete

Posted: Sat Mar 04, 2017 6:47 am
by ted70
well, like there is some progress
I added in the file /etc/dbus-1/system.d/org.freedesktop.login1.conf

Code: Select all

        <policy user="ted70">
                <allow own="org.freedesktop.login1"/>
                <allow send_destination="org.freedesktop.login1"/>
                <allow receive_sender="org.freedesktop.login1"/>
        </policy>
and now the error is the following

Code: Select all

[ERROR   ] 09:39:25 eventmanager:59 Event handler TorrentFinishedEvent failed in <bound method Core.on_event_torrent_finished of <autoshutdown.core.Core object at 0x7fc07d568bd0>> with exception org.freedesktop.DBus.Error.UnknownMethod: Unknown method 'Shutdown' or interface 'org.freedesktop.login1.Manager'.
I think the mistake in plugin
instead, the Shutdown should be PowerOff