Cannot set custom Download folder for Transmission and two UDP errors when starting Transmission

Mannekino

Patron
Joined
Nov 14, 2012
Messages
332
Hi,

I'm currently in the proces of switching over to FreeNAS 11.2 and I'm having two issues with Transmission I'm unable to solve.

Downloads folder keeps reverting back to the default settings

I've created a dataset named "Transmission" with a Downloads, Incomplete and Torrents (watch-dir) folder. I created a mount point for this dataset in the "/media" folder in the Transmission jail.

I've tried by setting the "Downloads" folder in the Transmission GUI but it doesn't save it. It keeps reverting back to the regular folder "/usr/local/etc/transmission/home/Downloads".

I also tried setting the folder in the "settings.json" file of Transmission (first shutting down Transmission then changing the configuration file) but that didn't work either.

Lastly I tried changing two files named "post_install.sh", there was a line:
Code:
transmission_download_dir="/usr/local/etc/transmission/home/Downloads"
And I changed it to
Code:
transmission_download_dir="/media/Downloads"
But that didn't work either which seems logical because the file is named "post_install.sh" but I thought I would give it a try thinking maybe it would be used somehow when starting Transmission.

UDP error when I start the Transmission plugin

When I start Transmission I see the following in the console output of FreeNAS. Any thoughts what did error means and how I can resolve it?

Code:
Oct 20 21:20:29 transmission transmission-daemon[7066]: UDP Failed to set receive buffer: No buffer space available (/wrkdirs/usr/ports/net-p2p/transmission-daemon/work/transmission-2.94/libtransmission/tr-udp.c:65)
Oct 20 21:20:29 transmission transmission-daemon[7066]: UDP Failed to set receive buffer: requested 4194304, got 42080 (/wrkdirs/usr/ports/net-p2p/transmission-daemon/work/transmission-2.94/libtransmission/tr-udp.c:84)
 

kdragon75

Wizard
Joined
Aug 7, 2016
Messages
2,457
The first one (folder reverting) is set as a variable in the transmission rc script /usr/local/etc/rc.d/transmission. If you modify that and service transmission restart you should be all set. This drove me nuts for a few weeks.
 

Mannekino

Patron
Joined
Nov 14, 2012
Messages
332
The first one is a known bug that should be fixed for RELEASE: https://redmine.ixsystems.com/issues/44317

Looks like the second one can be resolved with 2 Tunables, type Sysctl: https://falkhusemann.de/blog/2012/07/transmission-utp-and-udp-buffer-optimizations/

Thank you, hopefully it will be resolved in the final release.

Also I did some more searching after reading the information in the link you provided. That information was quite old so I tried to find something more recent. In some other posts I found the following two settings.
Code:
kern.ipc.maxsockbuf=16777216
net.inet.udp.recvspace=4194304
After settings these two in Tuneables I no longer got the error message when starting Transmission. If someone has any other suggestions for additional Tuneables let me know.

The first one (folder reverting) is set as a variable in the transmission rc script /usr/local/etc/rc.d/transmission. If you modify that and service transmission restart you should be all set. This drove me nuts for a few weeks.

Thanks this solved the issue for me!
 

kdragon75

Wizard
Joined
Aug 7, 2016
Messages
2,457
Thanks this solved the issue for me!
Yeah, I spent way longer than I should have figuring this out and it was MADDENING. I figured I would share the knowledge.
 

Mannekino

Patron
Joined
Nov 14, 2012
Messages
332
Bump for this problem, I just did a clean installation of Transmission and I'm still getting the same issue as I got back in October.

The bug report says that this issue should be fixed but if I change the download folder in the plugin it still reverts back to the default one after a restart of the jail?

Does anyone know what's going on? https://redmine.ixsystems.com/issues/44317
 

Nvious1

Explorer
Joined
Jul 12, 2018
Messages
67
Looks to me that the web gui just isn't able to or doesn't update the settings.json properly.

Just shell into the plugin from the jails screen and perform the following actions.
Code:
service transmission stop

##Set the following RC variables located in /etc/rc.conf
transmission_download_dir="/path/you/want/here"

##Additionally edit /usr/local/etc/transmission/settings.json
"download-dir": "/path/you/want/here",

service transmission start


Now your settings should be static. I can't say for sure if this will break on a plugin update or not.
 

Mannekino

Patron
Joined
Nov 14, 2012
Messages
332
I've been working on this for the past two hours now and I got another problem also. I've managed to configure the download directory by editing the file in /usr/local/etc/rc.d/transmission and configuring the download directory as follows:

Code:
: ${transmission_download_dir=/media/Downloads}

But another problem occurred and I've tried everything I can think of for the past two hours. I decided to finally submit a bug report. It looks like I cannot configure the "Incomplete" directory. I'm trying to edit the settings.json with this

Code:
"incomplete-dir": "/media/Incomplete",
"incomplete-dir-enabled": true,

But it gets overwritten with this after a restart of the jail:

Code:
"incomplete-dir": "//Downloads",
"incomplete-dir-enabled": false,

I tried setting it in the /etc/rc.conf also with transmission_incomplete_dir and transmission_incomplete_dir_enabled but that didn't work either.

Bug report here: https://redmine.ixsystems.com/issues/74280

This is with a complete fresh install of a Transmission plugin. The strange thing is, it works perfectly with the Transmission plugin I already had running and I compared all the settings from my old Transmission plugin with the new one and I cannot find any differences. Both plugins are running at the latest version.
 

Nvious1

Explorer
Joined
Jul 12, 2018
Messages
67
So I was able to get the download to stick and persist after a jail restart.

from jail shell
service transmission stop
sysrc transmission_download_dir="/my/path"
service transmission start

I see the transmission settings.json updated at start with this new path. If I stop the jail and restart that value seems to hold.

Now on the incomplete dir, there is currently no rc variable defined for this parameter. So setting those via sysrc or manually in rc.conf won't do any good if you don't some how alter the rc script.

I was just able to do the following
service transmission stop Edit settings.json, addjust incomplete values, and save service transmission start grep incomplete settings.json, yep changes still there. ## Restart jail from gui. actually stop, then start Come back into shell, grep incomplete from settings.json and its still good.

Seems the key is you need to make sure transmission is stopped before attempting to make and configuration changes to settings.json cause on a jail stop its going to right all the settings it has in memory probably to the file and revert them.
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
I didn't read all the posts but if you want to set the transmission download dir you set it in the rc.conf file.
Code:
sysrc transmission_download_dir="/mnt/transmission/downloads"
 

Mannekino

Patron
Joined
Nov 14, 2012
Messages
332
So I was able to get the download to stick and persist after a jail restart.

from jail shell
service transmission stop
sysrc transmission_download_dir="/my/path"
service transmission start

I see the transmission settings.json updated at start with this new path. If I stop the jail and restart that value seems to hold.

Thanks, I tried that also and it worked.

Now on the incomplete dir, there is currently no rc variable defined for this parameter. So setting those via sysrc or manually in rc.conf won't do any good if you don't some how alter the rc script.

I was just able to do the following
service transmission stop Edit settings.json, addjust incomplete values, and save service transmission start grep incomplete settings.json, yep changes still there. ## Restart jail from gui. actually stop, then start Come back into shell, grep incomplete from settings.json and its still good.

Seems the key is you need to make sure transmission is stopped before attempting to make and configuration changes to settings.json cause on a jail stop its going to right all the settings it has in memory probably to the file and revert them.

I feel so stupid, this was the cause, I kept changing the settings.json file while the jail and service were still running. I stopped the service and then changed the settings.json file and now it works. And yes, I figured putting the incomplete setting in the rc script or configuration probably wouldn't do anything since I didn't see it mentioned anywhere but I gave it a try anyways.

Is there documentation or a command to find out what kind of rc variables there are for a service?
 

Nvious1

Explorer
Joined
Jul 12, 2018
Messages
67
Is there documentation or a command to find out what kind of rc variables there are for a service?

Just look at the actual rc script. For transmission its..

/usr/local/etc/rc.d/transmission

Its pretty well documented inside the file. Most installed software tried to follow the heir structure by placing their rc scripts in that path and the file is the name of the service.
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
Is there documentation or a command to find out what kind of rc variables there are for a service?
cat /usr/local/etc/rc.d/transmission
Code:
#!/bin/sh
#
# $FreeBSD: branches/2019Q1/net-p2p/transmission-cli/files/transmission.in 373348 2014-11-24 18:51:26Z crees $
#
# PROVIDE: transmission
# REQUIRE: DAEMON
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable this service:
#
# transmission_enable:       Set to NO by default. Set it to YES to enable it.
# transmission_watch_dir:    Directory for torrent files to download
#                            automatically. Off by default unless you add
#                            a path.
# transmission_conf_dir:     Directory where transmission configuration
#                            data is stored.
#                            Default: /usr/local/etc/transmission/home
# transmission_download_dir: Directory to store downloaded data.
#                            Default: /usr/local/etc/transmission/home/Downloads
# transmission_user:         The user account transmission daemon runs as what
#                            you want it to be. It uses 'transmission' user by
#                            default.
# transmission_web_home:     Use alternative directory for the web interface
#                            files, such as javascript, html and graphics.
# transmission_chown:        By default, transmission checks and fixes the
#                            permissions for its home directory.  If this
#                            causes problems, set this variable to no.
#
 

Mannekino

Patron
Joined
Nov 14, 2012
Messages
332
Ah, I understand better now. So the script contains the default values for those variables and if you want to have other values you're supposed to set those with the sysrc command. You don't have to touch the script usually unless you maybe want to change something specific the script does. But you run the risk of the script changing to the default if you update the package.
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
Ah, I understand better now. So the script contains the default values for those variables and if you want to have other values you're supposed to set those with the sysrc command. You don't have to touch the script usually unless you maybe want to change something specific the script does. But you run the risk of the script changing to the default if you update the package.
yep, don't touch the script.
 

itskando

Contributor
Joined
Apr 30, 2018
Messages
172
My issues was no spaces allowed in path, even in quotes.
 

Erick Krigsvold

Dabbler
Joined
Jan 12, 2014
Messages
11
I have followed all the instructions on this thread and i still can't get it to work. this is probably a really dumb question but should my path be the same as my source Mount point? I have been tearing my hair out for a couple of days tying to get this to work. I am on 11.2 U5
 

Nvious1

Explorer
Joined
Jul 12, 2018
Messages
67
I have followed all the instructions on this thread and i still can't get it to work. this is probably a really dumb question but should my path be the same as my source Mount point? I have been tearing my hair out for a couple of days tying to get this to work. I am on 11.2 U5

Provide the output of your your rc.conf using command cat /etc/rc.conf | grep transmission
 

Mannekino

Patron
Joined
Nov 14, 2012
Messages
332
What have you tried, because the solution is basically to modify the rc.conf file. Here is how mine is currently setup in combination with a custom config directory for Transmission

Code:
root@transmission:~ # cat /etc/rc.conf | grep transmission
host_hostname="transmission"
transmission_enable="YES"
transmission_user="custom_user_name"
transmission_conf_dir="/config"
transmission_download_dir="/media/Transmission/Downloads"
transmission_chown="no"

Code:
root@transmission:~ # ls -al /config
total 205
drwxr-xr-x   5 custom_user_name  custom_user_name     10 Aug  6 16:48 .
drwxr-xr-x  20 root  wheel    24 Feb 19 18:34 ..
drwxr-xr-x   2 custom_user_name  custom_user_name      2 Oct 20  2018 blocklists
-rwxr-xr-x   1 custom_user_name  custom_user_name    694 Dec 28  2018 dht.dat
-rwxr-xr-x   1 custom_user_name  custom_user_name     14 Feb 20 07:17 extract.log
-rwxr-xr-x   1 custom_user_name  custom_user_name    147 Feb 20 07:17 extract.sh
drwxr-xr-x   2 custom_user_name  custom_user_name    272 Aug  6 16:48 resume
-rw-------   1 custom_user_name  custom_user_name   2352 Jul  1 10:47 settings.json
-rw-------   1 custom_user_name  custom_user_name    166 Aug  6 16:48 stats.json
drwxr-xr-x   2 custom_user_name  custom_user_name    272 Aug  2 19:40 torrents

I'm running transmission under a different user which is also the owner of the media mount point. I've replaced the actual user name with "custom_user_name" above.
 

Erick Krigsvold

Dabbler
Joined
Jan 12, 2014
Messages
11
root@transmission:~ # cat /etc/rc.conf | grep transmission
hostname="transmission"
transmission_enable="YES"
transmission_download_dir="/mnt/krigsvolds/Media/Downloads"
root@transmission:~ #
 
Top