bash - Transmission on FreeNAS does not call script on completion -
i have been trying running on week , @ loss. trying call script on completion using settings.json config so:
"script-torrent-done-enabled": true, "script-torrent-done-filename": "/posttorrent.sh", my script in root of jail , owned transmission. have checked permissions on file (which 755) , have run chmod +x /posttorrent.sh.
i have simplified file output log file so:
#!/bin/bash echo "$tr_torrent_name completed" >> /posttorrent.log however, far, still not have posttorrent.log file anywhere, no matter file download. not totally sure if on right track transmission set log level 3 , yet not see calls script in /var/log/debug.log. sure missing easy others have been able working, out of options think have read and/or tried find in relation issue. thanks!
the script relying on /bin/bash being present inside of jail. can either change script use /bin/sh, change /bin/bash /usr/bin/env bash, or link /path/to/port/bin/bash /usr/local/bin/bash (or wherever bash located relative jail directory, if exists should in /usr/local/bin).
ln -s /usr/local/bin/bash /path/to/jail/bin/bash also, root directory (by default) writable root, transmission user not have permission create log file in root directory. allow creation of log file change destination directory 1 transmission user has permission write to. example /var/db/transmission/posttorrent.log, if using freenas plugin. directory can created transmission user using install utility:
install -d -o transmission -g transmission /home/transmission alternatively log file can created manually using install utility, or owner can set chown:
install -o transmission -g transmission -m 644 /dev/null /posttorrent.log # or on existing log file chown transmission /posttorrent.log chgrp transmission /posttorrent.log # mode bits 644 chmod 644 /posttorrent.log transmission rewrite configuration file when exits. transmission-daemon has stopped before editing settings file. however, if using transmission plugin, settings stored in sqlite database
(/usr/pbi/transmission-amd64/transmissionui/transmission.db)
, settings file recreated database on startup. sqlite3 can used manually edit database, or plugin's settings can edited on freenas web ui.
sqlite3 /usr/pbi/transmission-amd64/transmissionui/transmission.db <<eof update freenas_transmission set enable=1; update freenas_transmission set script_post_torrent="/posttorrent.sh";
Comments
Post a Comment