[Plugin] Autoshutdown - Shutdown PC once torrents complete

Suggest, post, or discuss plugins for Deluge
Cas
Top Bloke
Top Bloke
Posts: 3424
Joined: Mon Dec 07, 2009 6:04 am
OS or Distro: Ubuntu 16.04
Location: Scotland

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

Postby Cas » Sat Nov 28, 2015 12:19 am

Are you using the latest version?

ifahmyy
New User
New User
Posts: 6
Joined: Fri Nov 27, 2015 12:38 am
OS or Distro: ubuntu14.4

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

Postby ifahmyy » Sat Nov 28, 2015 3:31 am

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

ifahmyy
New User
New User
Posts: 6
Joined: Fri Nov 27, 2015 12:38 am
OS or Distro: ubuntu14.4

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

Postby ifahmyy » Sat Nov 28, 2015 3:36 am

Also to be sure where's the leatest version?

ifahmyy
New User
New User
Posts: 6
Joined: Fri Nov 27, 2015 12:38 am
OS or Distro: ubuntu14.4

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

Postby ifahmyy » Sat Nov 28, 2015 3:45 am

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 :(

Cas
Top Bloke
Top Bloke
Posts: 3424
Joined: Mon Dec 07, 2009 6:04 am
OS or Distro: Ubuntu 16.04
Location: Scotland

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

Postby Cas » Sat Nov 28, 2015 12:36 pm

I have already responded to someone else with that same error already: viewtopic.php?f=9&t=41165&start=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

Cas
Top Bloke
Top Bloke
Posts: 3424
Joined: Mon Dec 07, 2009 6:04 am
OS or Distro: Ubuntu 16.04
Location: Scotland

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

Postby Cas » Sat Nov 28, 2015 2:10 pm

Found and fixed an issue with dbus and login1, so there is a new 1.4 release: https://github.com/cas--/autoshutdown/releases

mhertz
Leecher
Leecher
Posts: 85
Joined: Wed Jan 22, 2014 5:05 am
OS or Distro: Arch Linux

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

Postby mhertz » Sun Aug 14, 2016 4:27 pm

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 :)

mhertz
Leecher
Leecher
Posts: 85
Joined: Wed Jan 22, 2014 5:05 am
OS or Distro: Arch Linux

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

Postby mhertz » Fri Aug 26, 2016 1:49 am

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.

ted70
New User
New User
Posts: 2
Joined: Fri Mar 03, 2017 11:11 am
OS or Distro: Debian

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

Postby ted70 » Fri Mar 03, 2017 11:19 am

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

ted70
New User
New User
Posts: 2
Joined: Fri Mar 03, 2017 11:11 am
OS or Distro: Debian

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

Postby ted70 » Sat Mar 04, 2017 6:47 am

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


Return to “Plugins”

Who is online

Users browsing this forum: No registered users and 11 guests