Re: [Plugin] Autoshutdown - Shutdown PC once torrents comple
Posted: Sat Nov 28, 2015 12:19 am
Are you using the latest version?
Support Forum for the Deluge BitTorrent Client
https://forum.deluge-torrent.org/
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 ")
Code: Select all
import os
os.system("sleep 10 && pkill -9 deluge*")
Code: Select all
ted70@server:~$ dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1 "org.freedesktop.login1.Manager.PowerOff" boolean:true
[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
Code: Select all
<policy user="ted70">
<allow own="org.freedesktop.login1"/>
<allow send_destination="org.freedesktop.login1"/>
<allow receive_sender="org.freedesktop.login1"/>
</policy>
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'.