transmission settings.json is overwritten.

Status
Not open for further replies.

masterpc

Dabbler
Joined
Sep 12, 2011
Messages
17
Hi, I am newbie to FreeNAS.

If I knew 7 has more features than 8, I would install 7.
After transferring all data to the new storage (FreeNAS 8), I noticed that 8 has newer ZFS module, but missing features like Transmission, Itunes share...

Today, I upgraded my FreeNAS to the nightly version, FreeNAS-8r7661.
And I decided to install transmission manually.

After mounting with write mode, I typed pkg_add -r transmission-daemon. Soon, I realized that it's already shipped with the nightly version.

Therefore, I just added contents below to /conf/base/etc/rc.conf
Code:
transmission_enable="YES"
transmission_user="www"
transmission_conf_dir="/mnt/jtorrent/.transmission"
transmission_watch_dir="/mnt/jtorrent/.transmission/watch"
transmission_download_dir="/mnt/jtorrent"
transmission_flags="-a 127.0.0.1,192.168.*.*"


However, when I reboot my nas, /mnt/jtorrent/.transmission/settings.json is always restored as original.

Moreoever, I found some errors while booting..
Code:
Sep 12 22:16:43 jnas transmission-daemon[1323]: Couldn't create "/mnt/jtorrent/.transmission": Permission denied (utils.c:557)
Sep 12 22:16:43 jnas last message repeated 2 times
Sep 12 22:16:43 jnas transmission-daemon[1323]: UDP Failed to set receive buffer: No buffer space available (tr-udp.c:56)
Sep 12 22:16:43 jnas transmission-daemon[1323]: UDP Failed to set send buffer: No buffer space available (tr-udp.c:62)
Sep 12 22:16:43 jnas transmission-daemon[1323]: UDP Failed to set receive buffer: requested 4194304, got 42080 (tr-udp.c:75)
Sep 12 22:16:43 jnas transmission-daemon[1323]: UDP Failed to set send buffer: requested 1048576, got 9216 (tr-udp.c:86)
Sep 12 22:16:43 jnas transmission-daemon[1323]: Couldn't save temporary file "/mnt/jtorrent/.transmission/settings.json.tmp.Q4ZR55": No such file or directory (bencode.c:1734)


Of course, I already did chown -R www:www /mnt/jtorrents.
In addition to it, I changed permission 777 on /mnt/jtorrents and /mnt/jtorrents/.transmission.
However, the errors still show up.

I don't know what's going on, but it seems like that transmission is reset every time when freenas is restarted.

Any suggestion would be appreciated.


Thank you.
 

jfr2006

Contributor
Joined
May 27, 2011
Messages
174

masterpc

Dabbler
Joined
Sep 12, 2011
Messages
17
Hi, thank you for your reply.

The problem I have faced looks like a bit different because I'm using FreeNAS-8r7661.
Every time I reboot my nas, there's no active torrents although I downloaded some.
Also, I'm still getting the permission error below.
Code:
Sep 12 22:16:43 jnas transmission-daemon[1323]: Couldn't create "/mnt/jtorrent/.transmission": Permission denied (utils.c:557)


I think I can ignore the other error below, but I can't ignore the above error.
Code:
Sep 12 22:16:43 jnas transmission-daemon[1323]: UDP Failed to set receive buffer: No buffer space available (tr-udp.c:56)
Sep 12 22:16:43 jnas transmission-daemon[1323]: UDP Failed to set send buffer: No buffer space available (tr-udp.c:62)
Sep 12 22:16:43 jnas transmission-daemon[1323]: UDP Failed to set receive buffer: requested 4194304, got 42080 (tr-udp.c:75)
Sep 12 22:16:43 jnas transmission-daemon[1323]: UDP Failed to set send buffer: requested 1048576, got 9216 (tr-udp.c:86)


I guess the transmission-daemon is started before mounting /mnt/jtorrent.
That partition is UFS and not in RAID.

Is there any way to postpone running transmission-daemon?


Thank you.
 

jfr2006

Contributor
Joined
May 27, 2011
Messages
174
Ok.. I think i know what's happening..

For some reason i don't know why, transmission cams installed on that release. In my case is working, because my setings.json already exists from previous releases. I end up however with 2 transmission process running and i have to kill one of them. Try kill all the transmission process, edit the settings.json file and then restart to see if it keeps the modified settings.json file. If this does not work, i don't know what else can be done.
 

masterpc

Dabbler
Joined
Sep 12, 2011
Messages
17
Yes, you are correct.

If you copy /conf/base/etc/local/rc.d/transmission to /conf/base/etc/rc.d, two transmission daemons will be running.
I assume that both init script will be executed while booting, and they cause running two processes.

Well, I'm still looking for a clean solution.

Let's share if there is any better solution.

Thank you anyway.
 

masterpc

Dabbler
Joined
Sep 12, 2011
Messages
17
Finally, it works correctly.
Here is how I did on my NAS.

Since the nightly version already has transmission, I didn't pkg_add, and I just add a few lines to /conf/base/etc/rc.conf.

Code:
transmission_enable="YES"
transmission_user="www"
transmission_conf_dir="/mnt/jtorrent/.transmission"
transmission_watch_dir="/mnt/jtorrent/.transmission/watch"
transmission_download_dir="/mnt/jtorrent"
transmission_flags="-a 127.0.0.1,192.168.*.*"


I also didn't copy /conf/base/etc/local/rc.d/transmission to avoid running two daemons.
I edited /conf/base/etc/local/rc.d/transmission like below.

Code:
#!/bin/sh
#
# $FreeBSD: ports/net-p2p/transmission-cli/files/transmission.in,v 1.4 2011/03/05 04:17:28 mezz Exp $
#
# PROVIDE: transmission
# REQUIRE: NETWORKING SERVERS DAEMON ldconfig resolv smbd
# BEFORE: LOGIN
#


When system is booted, transmission-daemon will be started after samba.

I assume that giving a delay to transmission-daemon startup enables to run transmission-daemon after mounting storages fully.

Done!
 

jfr2006

Contributor
Joined
May 27, 2011
Messages
174
Great to know you were able to make it work ;)

Installed 8r7765n today and done has you have done..But i still get the buffer errors :(

Regards.
 

masterpc

Dabbler
Joined
Sep 12, 2011
Messages
17
The buffer errors seem to be a problem caused by Transmission.
Transmission requires 4MB UDP buffer, whereas FreeNAS's default UDP buffer is small like 42080.

To fix this problem,

mount -uw /
vi /conf/base/etc/sysctl.conf

Append two lines below to the end of the file.

Code:
kern.ipc.maxsockbuf=5242880
net.inet.udp.recvspace=4194304


You won't see the buffer errors anymore.

Done!

I forgot to mention this, reboot your NAS. :)


Edited /base/conf/etc/sysctl.conf -> /conf/base/etc/sysctl.conf
Thanks jfr!
 

jfr2006

Contributor
Joined
May 27, 2011
Messages
174

LAYGO

Explorer
Joined
Dec 21, 2011
Messages
85
Guys, I'm having a problem with Transmission in a Jail starting on a reboot. If I manually start it, I can access the Web GUI/Trans Remote GUI/TransDroid Remote (Android app for remote access).

I've made all my file edits to the files in my Serviio jail (from ProtoSD's tutorial) following this Transmission for noobs tutorial.

I'm modifying files from my Serviio jail & just having it run in there per ProtoSD's suggestion instead of making another jail (as could be seen in how I structured my paths).

I did pkg_add -r, copied to transmission to /base/conf/etc/rc.d/

The actual path would be: /mnt/pool/jails/Serviio_Jail/Serviio_root/...
Code:
[root@serviio /]# find / -name rc.conf
/usr/share/examples/etc/defaults/rc.conf
/etc/defaults/rc.conf
/etc/rc.conf
/conf/base/etc/rc.conf
/conf/base/etc/defaults/rc.conf


I've included this in my /conf/base/etc/rc.conf:
Code:
transmission_enable="YES"
transmission_conf_dir="/usr/local/transmission"
transmission_watch_dir="/usr/local/transmission/watch"
transmission_download_dir="/usr/local/transmission/finished"
transmission_user="www"


I had manually created a settings.json at /usr/local/transmisison. When I manually started with "transmission-daemon -g /user/local/transmission", it found/updated the file I had created there.

I did a test download & the file didn't end up in the params set in rc.conf, but the default of /root/download. It's like it's not seeing my rc.conf file & starting.

Any suggestions?

Fresh reboot, running: ps ax -o pid,jid,args (my JailID is 99):
Code:
... 
 1949     99 /usr/sbin/syslogd -s -C
 2098     99 /usr/sbin/sshd
 2109     99 /usr/sbin/cron -s
...
 2568     99 /usr/local/bin/ffmpeg -i /usr/local/serviio-0.6.0.1/media/video/movie/Tucker and Dale vs Evil (2010)(DD5.1)(DivX)(HQ)(AC3)(Externe Subs) TBS/movie/tucker.and.dale.vs.evil.
 2040     99 /usr/local/bin/bash /usr/local/serviio-0.6.0.1/bin/serviio.sh
 2060     99 [java]
...


Edit:
I forgot, I adopted something from the Serviio tutorial to have a directory accessible from FreeNAS & the Jail. I did the "chown -R www:www transmission/", but I think when I accessed the files via samba share, it changed the to root:wheel:
mount_nullfs -o rw /mnt/pool/download/transmission /mnt/pool/jails/Serviio_Jail/Serviio_root/usr/local/transmission

Also in the fstab.serviio:
Code:
#JAIL
/mnt/pool/media  /mnt/pool/jails/Serviio_Jail/Serviio_root/usr/local/serviio-0.6.0.1/media   nullfs rw 0 0
/mnt/pool/download/transmission   /mnt/pool/jails/Serviio_Jail/Serviio_root/usr/local/transmission   nullfs rw 0 0
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
LAYGO,

It sounds like you've done a great job learning how to integrate both apps into one jail. When you do stuff inside the jail, you don't need to edit the /conf/base/etc/ version of the files, you can directly edit /etc/rc.conf

Outside the jail in FreeNAS /conf/base/etc/rc.conf is where the static version is stored that overwrites the /etc/rc.conf on boot, but in a jail you don't need to worry about that.

Hope that helps!
 

LAYGO

Explorer
Joined
Dec 21, 2011
Messages
85
LAYGO,

It sounds like you've done a great job learning how to integrate both apps into one jail. When you do stuff inside the jail, you don't need to edit the /conf/base/etc/ version of the files, you can directly edit /etc/rc.conf

Outside the jail in FreeNAS /conf/base/etc/rc.conf is where the static version is stored that overwrites the /etc/rc.conf on boot, but in a jail you don't need to worry about that.

Hope that helps!

Awesome, I'll give that a try. I had did the "find / -name rc.conf" with the intent to ask what the relationship of all those were! You answered a question for me without me asking, nice job! ;) I'm not sure I understand ALL of the relationships, but it's a start. And I'm guessing the on boot is for FreeNAS alone, right?

And again, many thanks!
 

LAYGO

Explorer
Joined
Dec 21, 2011
Messages
85
Awww yea! Thanks again ProtoSD:

Code:
 1948     99 /usr/sbin/syslogd -s -C
 2022     99 /usr/local/bin/transmission-daemon -c /usr/local/transmission/watch -g /usr/local/transmission -w /usr/local/transmission/finished
 2109     99 /usr/sbin/sshd
 2120     99 /usr/sbin/cron -s
...
 2051     99 /usr/local/bin/bash /usr/local/serviio-0.6.0.1/bin/serviio.sh
 2066     99 [java]


And I was right about the user:group issue. It seems the linked dir I created will fubar the permissions if I touch it from my SMB share. I had gotten a permission error in the /var/log/jail_serviio_console.log, but I wasn't even getting any errors until I got the right rc.conf edited! :)

Also I edited & moved the the /base/conf/etc/rc.d/transmission to /etc/rc.d/ as well in the jail. LEARNING LEARNING! :)
 
Status
Not open for further replies.
Top