I don't really see how my scripts are getting in the way at all. I was hoping this was just something obvious that I was doing wrong, but I guess not.
On "Torrent Complete", deluge is configured to run "/media/.downloads/bin/copy_torrent.sh", which is the shell script noted above:
Code: Select all
{
"file": 1,
"format": 1
}{
"commands": [
[
"847b202c90fa8c12e30e5e2de53d0e0055fcac1d",
"complete",
"/media/.downloads/bin/copy_torrent.sh"
]
]
}
The full error provided by the python script is exactly what I provided; it's a one-line error that it can't read my configuration. Where I would expect it to be reading from /media/.downloads/.config/deluge, it's apparently trying to read from /root/.config/deluge. Which I don't really get: it should only use '/root/' as ${HOME} if this runs as the root user, which it obviously doesn't, as it can't read that directory.
I just grabbed a small torrent (some episode of Archer), and got the same error.
deluged is running as:
Code: Select all
_downloads 59450 4.2 0.4 188180 67284 - I 9:40PM 0:32.00 /usr/local/bin/python2.7 /usr/local/bin/deluged -c /media/.downloads/.config/deluge /media/.downloads/.config/deluge/python-eggs -L debug -l /var/tmp/deluged.log -P /var/run/deluged/pid
The debug log:
Code: Select all
[INFO ] 21:40:28 configmanager:70 Setting config directory to: /media/.downloads/.config/deluge
[INFO ] 21:40:31 daemon:124 Deluge daemon 1.3.6
[DEBUG ] 21:40:31 daemon:125 options: {'profile': False, 'loglevel': 'debug', 'quiet': False, 'ui_interface': None, 'listen_interface': None, 'logfile': '/var/tmp/deluged.log', 'config': '/media/.downloads/.config/deluge', 'port': None, 'pidfile': '/var/run/deluged/pid', 'donot': False}
[DEBUG ] 21:40:31 daemon:126 args: ['/media/.downloads/.config/deluge/python-eggs']
[INFO ] 21:40:31 configmanager:70 Setting config directory to: /media/.downloads/.config/deluge
[DEBUG ] 21:40:31 core:76 Core init..
[INFO ] 21:40:31 core:80 Starting libtorrent 0.16.17.0 session..
[DEBUG ] 21:40:31 configmanager:111 Getting config 'core.conf'
<snip>
[DEBUG ] 21:44:14 alertmanager:123 torrent_finished_alert: Archer.2009.S05E13.HDTV.x264-KILLERS.mp4 torrent finished downloading
[DEBUG ] 21:44:14 alertmanager:123 state_changed_alert: Archer.2009.S05E13.HDTV.x264-KILLERS.mp4: state changed to: finished
[DEBUG ] 21:44:14 alertmanager:123 state_changed_alert: Archer.2009.S05E13.HDTV.x264-KILLERS.mp4: state changed to: seeding
[DEBUG ] 21:44:14 alertmanager:123 tracker_announce_alert: Archer.2009.S05E13.HDTV.x264-KILLERS.mp4 (udp://tracker.openbittorrent.com:80) sending announce (completed)
[DEBUG ] 21:44:14 torrentmanager:878 on_alert_torrent_finished
[DEBUG ] 21:44:14 torrentmanager:884 5d26a202e38e40d4437a92acf6405e27b7de3f11 is finished..
[DEBUG ] 21:44:14 rpcserver:466 intevents: {2: ['TorrentRemovedEvent', 'PluginEnabledEvent', 'TorrentAddedEvent', 'PluginDisabledEvent', 'TorrentStateChangedEvent', 'ConfigValueChangedEvent']}
[DEBUG ] 21:44:14 common:79 Calling CORE's custom email providers for TorrentFinishedEvent: ('5d26a202e38e40d4437a92acf6405e27b7de3f11',) {}
[DEBUG ] 21:44:14 core:119 [execute] Running commands for complete
[DEBUG ] 21:44:14 core:135 [execute] running /media/.downloads/bin/copy_torrent.sh
[DEBUG ] 21:44:14 torrent:381 set_state_based_on_ltstate: Seeding
[DEBUG ] 21:44:14 torrent:382 session.is_paused: False
[DEBUG ] 21:44:14 torrentmanager:1028 on_alert_state_changed
[DEBUG ] 21:44:14 torrent:381 set_state_based_on_ltstate: Seeding
[DEBUG ] 21:44:14 torrent:382 session.is_paused: False
[DEBUG ] 21:44:14 torrentmanager:1028 on_alert_state_changed
[DEBUG ] 21:44:14 torrent:381 set_state_based_on_ltstate: Seeding
[DEBUG ] 21:44:14 torrent:382 session.is_paused: False
[DEBUG ] 21:44:14 torrentmanager:976 on_alert_tracker_announce
[DEBUG ] 21:44:14 alertmanager:123 save_resume_data_alert: Archer.2009.S05E13.HDTV.x264-KILLERS.mp4 resume data generated
[DEBUG ] 21:44:14 torrentmanager:1048 on_alert_save_resume_data
[DEBUG ] 21:44:14 torrentmanager:736 Opening torrents fastresume file for load.
[DEBUG ] 21:44:14 torrentmanager:776 Saving fastresume file: /media/.downloads/.config/deluge/state/torrents.fastresume
[DEBUG ] 21:44:14 alertmanager:123 peer_blocked_alert: Archer.2009.S05E13.HDTV.x264-KILLERS.mp4: blocked peer: <removed>
[DEBUG ] 21:44:14 alertmanager:123 peer_blocked_alert: Archer.2009.S05E13.HDTV.x264-KILLERS.mp4: blocked peer: <removed>
[DEBUG ] 21:44:14 alertmanager:123 tracker_reply_alert: Archer.2009.S05E13.HDTV.x264-KILLERS.mp4 (udp://tracker.openbittorrent.com:80) received peers: 200
[DEBUG ] 21:44:14 torrentmanager:959 on_alert_tracker_reply: Archer.2009.S05E13.HDTV.x264-KILLERS.mp4 (udp://tracker.openbittorrent.com:80) received peers: 200
The script was run with the following arguments:
Code: Select all
5d26a202e38e40d4437a92acf6405e27b7de3f11 Archer.2009.S05E13.HDTV.x264-KILLERS.mp4 /media/.downloads/torrents/incoming
I added some debugging, so I can confirm that the script *is* running as the "_downloads" user.
The output of the python script:
Code: Select all
[ERROR ] 21:44:17 common:167 Unable to use default config directory, exiting... ([Errno 13] Permission denied: '/root/.config/deluge')
Since that went to STDERR and not STDOUT, the shell script identified no label, so the rsync command that was run:
Code: Select all
rsync -HrltpDq /media/.downloads/torrents/incoming/Archer.2009.S05E13.HDTV.x264-KILLERS.mp4 /media/New/