Transmission Watch Directory

SavageAUS

Patron
Joined
Jul 9, 2016
Messages
418
Just wondering if anyone knows how to set the watch directory using the plugin system on FreeNAS 11.2 Beta 2. I can set complete and incomplete just missing my watch directory.
 

emk2203

Guru
Joined
Nov 11, 2012
Messages
573
As a workaround, you can enter the jail and edit /var/db/transmission/settings.json directly (transmission should be stopped or the changes won't stick).
 

SavageAUS

Patron
Joined
Jul 9, 2016
Messages
418
As a workaround, you can enter the jail and edit /var/db/transmission/settings.json directly (transmission should be stopped or the changes won't stick).
Unfortunately with the plugin and in the shell for transmission. If i go to cd /var/db there is no transmission folder.

Edit:
I found settings.json located at /usr/local/etc/transmission/home
 

SavageAUS

Patron
Joined
Jul 9, 2016
Messages
418
There is no option for a watch directory in the settings.json for the new iocage plugins
Code:
{
	"alt-speed-down": 50,
	"alt-speed-enabled": false,
	"alt-speed-time-begin": 540,
	"alt-speed-time-day": 127,
	"alt-speed-time-enabled": false,
	"alt-speed-time-end": 1020,
	"alt-speed-up": 50,
	"bind-address-ipv4": "0.0.0.0",
	"bind-address-ipv6": "::",
	"blocklist-enabled": false,
	"blocklist-url": "http://www.example.com/blocklist",
	"cache-size-mb": 4,
	"dht-enabled": true,
	"download-dir": "/usr/local/etc/transmission/home/Downloads",
	"download-queue-enabled": true,
	"download-queue-size": 5,
	"encryption": 1,
	"idle-seeding-limit": 30,
	"idle-seeding-limit-enabled": false,
	"incomplete-dir": "//Downloads",
	"incomplete-dir-enabled": false,
	"lpd-enabled": false,
	"message-level": 2,
	"peer-congestion-algorithm": "",
	"peer-id-ttl-hours": 6,
	"peer-limit-global": 200,
	"peer-limit-per-torrent": 50,
	"peer-port": 51413,
	"peer-port-random-high": 65535,
	"peer-port-random-low": 49152,
	"peer-port-random-on-start": false,
	"peer-socket-tos": "default",
	"pex-enabled": true,
	"pidfile": "/var/run/transmission/daemon.pid",
	"port-forwarding-enabled": true,
	"preallocation": 1,
	"prefetch-enabled": true,
	"queue-stalled-enabled": true,
	"queue-stalled-minutes": 30,
	"ratio-limit": 2,
	"ratio-limit-enabled": false,
	"rename-partial-files": true,
	"rpc-authentication-required": false,
	"rpc-bind-address": "0.0.0.0",
	"rpc-enabled": true,
	"rpc-host-whitelist": "",
	"rpc-host-whitelist-enabled": true,
	"rpc-password": "{7eac3ff59b3096c109ac802f12741e9275bccabaMsoDrSAs",
	"rpc-port": 9091,
	"rpc-url": "/transmission/",
	"rpc-username": "",
	"rpc-whitelist": "127.0.0.1",
	"rpc-whitelist-enabled": false,
	"scrape-paused-torrents-enabled": true,
	"script-torrent-done-enabled": false,
	"script-torrent-done-filename": "",
	"seed-queue-enabled": false,
	"seed-queue-size": 10,
	"speed-limit-down": 100,
	"speed-limit-down-enabled": false,
	"speed-limit-up": 100,
	"speed-limit-up-enabled": false,
	"speed-limit-up": 100,
	"speed-limit-up-enabled": false,
	"start-added-torrents": true,
	"trash-original-torrent-files": false,
	"umask": 18,
	"upload-slots-per-torrent": 14,
	"utp-enabled": true
}
 

emk2203

Guru
Joined
Nov 11, 2012
Messages
573
Unfortunately with the plugin and in the shell for transmission. If i go to cd /var/db there is no transmission folder.

Edit:
I found settings.json located at /usr/local/etc/transmission/home
I was just about to tell you that, the location was is over the place in the different versions. For anyone reading this in the future: The best way is to issue a find / -name 'settings.json' in the transmission jail to find the location.

Regarding the watch directory: I have this currently up and running, so the functionality is there. Just add the lines
Code:
	"watch-dir": "/mnt/tank/torrents",
	"watch-dir-enabled": true

and you are good to go.

In my setup, the watch directory is monitored for new .torrent files, which are added by a script to an archive after the torrent has finished. Incomplete files are downloaded to a second pool on SSD for performance reasons and transferred to the main pool on traditional hard disks after the download finishes.

Bottom line, the transmission plugin allows for fairly complex setups, just by adding the right options to settings.json. This is regardless of what the GUI of FreeNAS shows.
 
  • Like
Reactions: cmh

SavageAUS

Patron
Joined
Jul 9, 2016
Messages
418
Now with a fresh plugin install i get this.....sigh
Code:
404: Not Found
Couldn't find Transmission's web interface files!

Users: to tell Transmission where to look, set the TRANSMISSION_WEB_HOME environment variable to the folder where the web interface's index.html is located.

Package Builders: to set a custom default at compile time, #define PACKAGE_DATA_DIR in libtransmission/platform.c or tweak tr_getClutchDir () by hand.

Edit: Solved this issue but a new one arises.

Even though i stop the jail and modify my settings.json the changes don't stick because the jail automatically restarts itself even with the auto restart option off.

Ok so most settings save except for "download-dir":, it always reverts back to default.
 
Last edited:

SavageAUS

Patron
Joined
Jul 9, 2016
Messages
418
I was just about to tell you that, the location was is over the place in the different versions. For anyone reading this in the future: The best way is to issue a find / -name 'settings.json' in the transmission jail to find the location.

Regarding the watch directory: I have this currently up and running, so the functionality is there. Just add the lines
Code:
	"watch-dir": "/mnt/tank/torrents",
	"watch-dir-enabled": true

and you are good to go.

In my setup, the watch directory is monitored for new .torrent files, which are added by a script to an archive after the torrent has finished. Incomplete files are downloaded to a second pool on SSD for performance reasons and transferred to the main pool on traditional hard disks after the download finishes.

Bottom line, the transmission plugin allows for fairly complex setups, just by adding the right options to settings.json. This is regardless of what the GUI of FreeNAS shows.
Are you able to share your mount points in FreeNAS GUI and from transmission console also from settings.json so I can see what I’m doing wrong. Thanks.


Sent from my iPhone using Tapatalk
 
Last edited:

gt2416

Patron
Joined
Feb 4, 2018
Messages
262
i had problems editing the .json file as well. Stop the transmission service inside the jail then edit the json. You dont have to restart the jail.
 

SavageAUS

Patron
Joined
Jul 9, 2016
Messages
418
i had problems editing the .json file as well. Stop the transmission service inside the jail then edit the json. You don't have to restart the jail.
Thanks but I was doing but the download location (completed) won’t allow me to change it.


Sent from my iPhone using Tapatalk
 

emk2203

Guru
Joined
Nov 11, 2012
Messages
573
My jails have the following mount points besides the internal stuff generated by iocage (?):

Code:
/mnt/tank/torrents is mapped r/w to /mnt/iocage/jails/transmission/root/mnt/tank/torrents
/mnt/tank/incoming is mapped r/w to /mnt/iocage/jails/transmission/root/mnt/tank incoming
/mnt/ssd120/incomplete is mapped r/w to /mnt/iocage/jails/transmission/root/mnt/ssd120/incomplete


The only place in Transmission's WebUI where anything of this shows up is in settings: Downloading tab; download to /mnt/tank/incoming
Probably best way to see this is in settings.json:

Code:
{
	"alt-speed-down": 5000,
	"alt-speed-enabled": false,
	"alt-speed-time-begin": 540,
	"alt-speed-time-day": 127,
	"alt-speed-time-enabled": false,
	"alt-speed-time-end": 1020,
	"alt-speed-up": 500,
	"bind-address-ipv4": "0.0.0.0",
	"bind-address-ipv6": "::",
	"blocklist-enabled": false,
	"blocklist-url": "http://www.example.com/blocklist",
	"cache-size-mb": 4,
	"dht-enabled": true,
	"download-dir": "/usr/local/etc/transmission/home/Downloads", <--- should be /mnt/tank/incoming
	"download-queue-enabled": true,
	"download-queue-size": 5,
	"encryption": 1,
	"idle-seeding-limit": 2880,
	"idle-seeding-limit-enabled": true,
	"incomplete-dir": "/mnt/ssd120/incomplete",
	"incomplete-dir-enabled": true,
	"lpd-enabled": false,
	"message-level": 2,
	"peer-congestion-algorithm": "",
	"peer-id-ttl-hours": 6,
	"peer-limit-global": 200,
	"peer-limit-per-torrent": 50,
	"peer-port": 51413,
	"peer-port-random-high": 65535,
	"peer-port-random-low": 49152,
	"peer-port-random-on-start": false,
	"peer-socket-tos": "default",
	"pex-enabled": true,
	"pidfile": "/var/run/transmission/daemon.pid",
	"port-forwarding-enabled": true,
	"preallocation": 1,
	"prefetch-enabled": true,
	"queue-stalled-enabled": true,
	"queue-stalled-minutes": 30,
	"ratio-limit": 5,
	"ratio-limit-enabled": true,
	"rename-partial-files": true,
	"rpc-authentication-required": true,
	"rpc-bind-address": "0.0.0.0",
	"rpc-enabled": true,
	"rpc-host-whitelist": "",
	"rpc-host-whitelist-enabled": true,
	"rpc-password": "",
	"rpc-port": 9091,
	"rpc-url": "/transmission/",
	"rpc-username": "emk2203",
	"rpc-whitelist": "",
	"rpc-whitelist-enabled": false,
	"scrape-paused-torrents-enabled": true,
	"script-torrent-done-enabled": true,
	"script-torrent-done-filename": "/mnt/tank/torrents/torrentarchive.sh",
	"seed-queue-enabled": false,
	"seed-queue-size": 10,
	"speed-limit-down": 100,
	"speed-limit-down-enabled": false,
	"speed-limit-up": 2000,
	"speed-limit-up-enabled": true,
	"start-added-torrents": true,
	"trash-original-torrent-files": false,
	"umask": 2,
	"upload-slots-per-torrent": 14,
	"utp-enabled": true,
	"watch-dir": "/mnt/tank/torrents",
	"watch-dir-enabled": true
}


And ... I'll be damned. It's like quantum physics. The sheer act of looking at it made the download directory default to its new location. What's worse, I am not able to fix it right away. Changing it with vi in settings.json makes it reappear after service start transmission.

I'll update this later.

EDIT: I tried to get a feel for what's happening by changing ownership and access rights on the share. Even with 0777 rights, after startup of transmission, the download directory reverses to default. Did this from the command line, by the way. Stopping or killing transmission doesn't make a difference from within the jail. Stopping the jail and restarting didn't help, either.

So what did work?

I went to the transmission WebUI and changed the download directory from there. The changes don't survive - a cat /usr/local/etc/transmission/home/settings.json | grep dir has again the default download directory - but they are kept in memory and the transmission process remembers them if you close the settings and then reopen them.

For the moment, a restarted transmission process by whatever means seems to wipe the download location and replace with default at startup. A manual change via WebUI or remote transmission sets the correct location, but this is just in memory and not saved to settings.json. A manual edit of settings.json with the correct location afterwards is no help, even though it now matches the transmission settings in memory with the settings on file.

settings.json has 0600 for transmission:transmission, as it should be. The other custom settings except for the download directory survive, no problem. Anyone able to give more insight on this?
 
Last edited:

emk2203

Guru
Joined
Nov 11, 2012
Messages
573
i had problems editing the .json file as well. Stop the transmission service inside the jail then edit the json. You don't have to restart the jail.
This time, it's different. The download location gets changed after startup of transmission. Stopping the service before editing is still mandatory for other changes, but it doesn't help for the download directory.
 

SavageAUS

Patron
Joined
Jul 9, 2016
Messages
418
My jails have the following mount points besides the internal stuff generated by iocage (?):

Code:
/mnt/tank/torrents is mapped r/w to /mnt/iocage/jails/transmission/root/mnt/tank/torrents
/mnt/tank/incoming is mapped r/w to /mnt/iocage/jails/transmission/root/mnt/tank incoming
/mnt/ssd120/incomplete is mapped r/w to /mnt/iocage/jails/transmission/root/mnt/ssd120/incomplete


The only place in Transmission's WebUI where anything of this shows up is in settings: Downloading tab; download to /mnt/tank/incoming
Probably best way to see this is in settings.json:

Code:
{
	"alt-speed-down": 5000,
	"alt-speed-enabled": false,
	"alt-speed-time-begin": 540,
	"alt-speed-time-day": 127,
	"alt-speed-time-enabled": false,
	"alt-speed-time-end": 1020,
	"alt-speed-up": 500,
	"bind-address-ipv4": "0.0.0.0",
	"bind-address-ipv6": "::",
	"blocklist-enabled": false,
	"blocklist-url": "http://www.example.com/blocklist",
	"cache-size-mb": 4,
	"dht-enabled": true,
	"download-dir": "/usr/local/etc/transmission/home/Downloads", <--- should be /mnt/tank/incoming
	"download-queue-enabled": true,
	"download-queue-size": 5,
	"encryption": 1,
	"idle-seeding-limit": 2880,
	"idle-seeding-limit-enabled": true,
	"incomplete-dir": "/mnt/ssd120/incomplete",
	"incomplete-dir-enabled": true,
	"lpd-enabled": false,
	"message-level": 2,
	"peer-congestion-algorithm": "",
	"peer-id-ttl-hours": 6,
	"peer-limit-global": 200,
	"peer-limit-per-torrent": 50,
	"peer-port": 51413,
	"peer-port-random-high": 65535,
	"peer-port-random-low": 49152,
	"peer-port-random-on-start": false,
	"peer-socket-tos": "default",
	"pex-enabled": true,
	"pidfile": "/var/run/transmission/daemon.pid",
	"port-forwarding-enabled": true,
	"preallocation": 1,
	"prefetch-enabled": true,
	"queue-stalled-enabled": true,
	"queue-stalled-minutes": 30,
	"ratio-limit": 5,
	"ratio-limit-enabled": true,
	"rename-partial-files": true,
	"rpc-authentication-required": true,
	"rpc-bind-address": "0.0.0.0",
	"rpc-enabled": true,
	"rpc-host-whitelist": "",
	"rpc-host-whitelist-enabled": true,
	"rpc-password": "",
	"rpc-port": 9091,
	"rpc-url": "/transmission/",
	"rpc-username": "emk2203",
	"rpc-whitelist": "",
	"rpc-whitelist-enabled": false,
	"scrape-paused-torrents-enabled": true,
	"script-torrent-done-enabled": true,
	"script-torrent-done-filename": "/mnt/tank/torrents/torrentarchive.sh",
	"seed-queue-enabled": false,
	"seed-queue-size": 10,
	"speed-limit-down": 100,
	"speed-limit-down-enabled": false,
	"speed-limit-up": 2000,
	"speed-limit-up-enabled": true,
	"start-added-torrents": true,
	"trash-original-torrent-files": false,
	"umask": 2,
	"upload-slots-per-torrent": 14,
	"utp-enabled": true,
	"watch-dir": "/mnt/tank/torrents",
	"watch-dir-enabled": true
}


And ... I'll be damned. It's like quantum physics. The sheer act of looking at it made the download directory default to its new location. What's worse, I am not able to fix it right away. Changing it with vi in settings.json makes it reappear after service start transmission.

I'll update this later.

EDIT: I tried to get a feel for what's happening by changing ownership and access rights on the share. Even with 0777 rights, after startup of transmission, the download directory reverses to default. Did this from the command line, by the way. Stopping or killing transmission doesn't make a difference from within the jail. Stopping the jail and restarting didn't help, either.

So what did work?

I went to the transmission WebUI and changed the download directory from there. The changes don't survive - a cat /usr/local/etc/transmission/home/settings.json | grep dir has again the default download directory - but they are kept in memory and the transmission process remembers them if you close the settings and then reopen them.

For the moment, a restarted transmission process by whatever means seems to wipe the download location and replace with default at startup. A manual change via WebUI or remote transmission sets the correct location, but this is just in memory and not saved to settings.json. A manual edit of settings.json with the correct location afterwards is no help, even though it now matches the transmission settings in memory with the settings on file.

settings.json has 0600 for transmission:transmission, as it should be. The other custom settings except for the download directory survive, no problem. Anyone able to give more insight on this?
I’m glad I’m not the only one with this issue. Can you file a ticket on bugs.freenas? My account isn’t working.
I’m hoping this is also linked to why couch potato won’t move and rename completed downloads. I have all my media and downloads datasets set to nobody:nogroup 777 so permissions shouldn’t be a problem.


Sent from my iPhone using Tapatalk
 

emk2203

Guru
Joined
Nov 11, 2012
Messages
573
I’m glad I’m not the only one with this issue. Can you file a ticket on bugs.freenas? My account isn’t working.
I’m hoping this is also linked to why couch potato won’t move and rename completed downloads. I have all my media and downloads datasets set to nobody:nogroup 777 so permissions shouldn’t be a problem.
In the meantime, I found a more permanent fix:
Code:
sudo iocage console transmission
vi /etc/rc.conf

Append the line transmission_download_dir="/path/to/download/directory"

Now the default download directory is your own download directory, and it doesn't matter if it gets set each time at restart.
 
Last edited:

SavageAUS

Patron
Joined
Jul 9, 2016
Messages
418
In the meantime, I found a more permanent fix:
Code:
sudo iocage console transmission
vi /etc/rc.conf

Append the line transmission_download_dir="/path/to/download/directory"

Now the default download directory is your own download directory, and it doesn't matter if it gets set each time at restart.

Been using this
transmission_download_dir="/path/to/download/directory"
For a while and working well. I know it’s off topic but my couchpotato is meant to be moving downloads from transmissions completed folder to my movies folder but it’s copying then renaming, not renaming and moving. Couchpotato file and folder permissions are set to 0777 and I have the permissions on datasets set to nobody nogroup. But when I try to delete the file left behind from from a windows or macOS machine I have to reset dataset permissions back to nobody nogroup so either transmission or couchpotato is modifying the file and folder permissions.



Sent from my iPhone using Tapatalk
 
Last edited:

emk2203

Guru
Joined
Nov 11, 2012
Messages
573
I'm not familiar with Couchpotato at all, but I think it's clear that the permission change you observe also inhibits Couchpotato's normal operation. Somethink like a simple ls -l in the download directory should tell you what happens. Out of the jail, the transmission user has the UID / GID of 921 / 921. You can also set Transmission's permissions somewhere in settings.json.

If anything else fails, let transmission run as the couchpotato user. This can also be set in settings.json.
 

SavageAUS

Patron
Joined
Jul 9, 2016
Messages
418
Here is the output of ls -l
Yes it’s the incomplete directory but I have nothing in completed at the moment and the permissions should be the same.
ab4ad0e0e29d9da9270f7dba2f129e48.png



Sent from my iPhone using Tapatalk
 

emk2203

Guru
Joined
Nov 11, 2012
Messages
573
That's clearly the transmission user who owns the file. Also, there are extended attributes there, which you can get by getfacl /mnt/JailsSSD/Downloads/Incomplete/Captain*. They are ultimately the permissions that count.

You set this up as a Windows share, didn't you? In my experience, it is better to have only the UNIX attributes for everything where FreeNAS or plugins still work with, like these intermediate directories.

Remove them like here: https://unix.stackexchange.com/ques...-a-directory-and-back-to-usual-access-control and see if it helps. Can be done by a transmission script later, if needed.
 

SavageAUS

Patron
Joined
Jul 9, 2016
Messages
418
That's clearly the transmission user who owns the file. Also, there are extended attributes there, which you can get by getfacl /mnt/JailsSSD/Downloads/Incomplete/Captain*. They are ultimately the permissions that count.

You set this up as a Windows share, didn't you? In my experience, it is better to have only the UNIX attributes for everything where FreeNAS or plugins still work with, like these intermediate directories.

Remove them like here: https://unix.stackexchange.com/ques...-a-directory-and-back-to-usual-access-control and see if it helps. Can be done by a transmission script later, if needed.
It’s a cifs share yes but Unix permissions.
22786a3600496e08347ff11cab2e40dd.png


Sent from my iPhone using Tapatalk
 

SavageAUS

Patron
Joined
Jul 9, 2016
Messages
418
It appears to all be working correctly for the time being after I changed the mount point in the jail from /mnt/foldername to /media/foldername.

Edit: I stand corrected, completed downloads are not being moved they are being copied.
 
Last edited:

emk2203

Guru
Joined
Nov 11, 2012
Messages
573
It’s a cifs share yes but Unix permissions.
22786a3600496e08347ff11cab2e40dd.png


Sent from my iPhone using Tapatalk
The permissions here are not different from the plain UNIX permissions - the owner (transmission, UID 921) and the group are allowed to everything, while 'other' = everyone has only read acess.

To get out of this, I would not waste time with root cause analysis any further, but use a dirty trick:

Look at the procedure here to run transmission as another user. In this case, the couchpotato user. Enter the jail, create the couchpotato user with the same UID / GID, then let transmission run as user couchpotato. This should solve the issue.
 
Top