Page 1 of 1
Bubba3 downloads torrents to wrong user directory
Posted: 04 Mar 2011, 08:26
by AzP
Hi guys
My first post on the forum since I received my B3 on monday. Great product, I just need to get everything setup right. My main plan is to use it with my Linn Sneaky DS player, and so far it's been "ok" (sadly not great) but it's hopefully because I haven't set everything up yet. For instance album artwork doesn't show in Mediatomb, but it doesn't seem to have support for that either (except when it's id3-embedded).
The minidlna server was better, but at first try I only got perhaps 10 out of 200 album covers. But that's not why I'm here =)
I added some torrent files to my users torrent-directory (/home/peter/torrents/), and was surprised to see that they weren't being downloaded. It was late, and I figured the torrent client only scanned the directory every-now-and-then, so I left it for the very next day. Nothing was downloaded then either, until I logged in as admin and saw that the torrents had been downloaded into
instead of
That seems a bit strange. I checked the configuration files for the filedownloader and it did point to the "$USERNAME" variable, so I thought it would download it to the same user directory where it found the torrent files.
Is this by design or a bug/configuration thing?
Re: Bubba3 downloads torrents to wrong user directory
Posted: 04 Mar 2011, 14:33
by Cheeseboy
Hi Azp, and welcome!
What you describe sounds strange.
I just copied a .torrent file into /home/niklas/torrents, and the FTD immediately created the files in /home/niklas/downloads
You mention directories called "download" without the trailing s. Did you change something?
Where you perhaps using the web interface, still being logged in as admin?
Best regards,
Cheeseboy
Re: Bubba3 downloads torrents to wrong user directory
Posted: 05 Mar 2011, 07:11
by AzP
Hi, thx for the reply!
That sounds strange, but it's good to see that it's supposed to behave as I'd like =)
I just misspelled Downloads, I was at work and didn't remember the name of the directory. I didn't upload the torrents using the web interface, I instead have the torrent folder mounted via NFS on my computer.
I can try to upload a torrent using the interface instead and see what happens then.
Re: Bubba3 downloads torrents to wrong user directory
Posted: 05 Mar 2011, 08:21
by AzP
I think the problem is that I'm mounting the NFS filesystem as root, which then means that the files are owned by admin. I need to figure out how to mount the filesystem as the right user.
Re: Bubba3 downloads torrents to wrong user directory
Posted: 05 Mar 2011, 08:23
by RandomUsername
Well how are you mounting the share at the moment?
Re: Bubba3 downloads torrents to wrong user directory
Posted: 05 Mar 2011, 08:54
by AzP
I added this to my fstab:
Code: Select all
# Bubba
b3:/home/storage /mnt/b3 nfs defaults,_netdev,user,auto 0 0
b3:/home/peter/torrents /mnt/torrents nfs defaults,_netdev,user,auto 0 0
I guess uid=xyz and gid=xyz might be a solution. Umask doesn't help me since the read/write permissions is not the issue...
Re: Bubba3 downloads torrents to wrong user directory
Posted: 05 Mar 2011, 08:59
by AzP
I think the uid/guid is the actual issue. When I look at the files via nfs mount, I get:
Code: Select all
peter@skare$ ll torrents/
totalt 84K
-rw-r--r-- 1 peter users 20K 2 mar 01.19 Californication.S04E06.HDTV.XviD-LOL.torrent
-rw-r--r-- 1 peter users 21K 2 mar 01.19 Californication.S04E07.HDTV.XviD-LOL.torrent
-rw-r--r-- 1 peter users 21K 2 mar 01.19 Californication.S04E08.HDTV.XviD-LOL.torrent
-rw-r--r-- 1 peter users 16K 2 mar 01.21 Two.and.a.Half.Men.S08E16.HDTV.XviD-LOL.torrent
I think that "peter" has uid 2 (I assume root is 1). But when I look at the directory when ssh:d on the B3, I get:
Code: Select all
peter@b3:~$ ll torrents/
totalt 84K
-rw-r--r-- 1 admin users 20K 2 mar 01.19 Californication.S04E06.HDTV.XviD-LOL.torrent
-rw-r--r-- 1 admin users 21K 2 mar 01.19 Californication.S04E07.HDTV.XviD-LOL.torrent
-rw-r--r-- 1 admin users 21K 2 mar 01.19 Californication.S04E08.HDTV.XviD-LOL.torrent
-rw-r--r-- 1 admin users 16K 2 mar 01.21 Two.and.a.Half.Men.S08E16.HDTV.XviD-LOL.torrent
where I assume "admin" has uid 2 (root must be 1 here as well) and the user "peter" has uid 3. That seems to fit, since when I create something on the b3 as "peter", that is mapped to my uid 3 on my computer (skare).
Re: Bubba3 downloads torrents to wrong user directory
Posted: 05 Mar 2011, 10:31
by Cheeseboy
Hi,
Every time I install a new Linux system on my network I take pains to make sure my UID are the same for my logins across the network.
This usually means creating a temporarily user (with a UID other than 1001) and then do a usermod -u on my real username.
I just tried adding a .torrent file from my Ubuntu machine to a mounted NFS share on the B3 to my ~/torrents directory, and the files where created in ~/downloads as expected, and owned by the correct user.
This is from /etc/fstab on my Ubuntu machine:
Code: Select all
b3:/home /media/b3_home nfs user,rw,async 0 1
Re: Bubba3 downloads torrents to wrong user directory
Posted: 05 Mar 2011, 11:57
by AzP
And you have the same uid for the same user on both machines?
Hmm, I wonder if it's ok to change UID on any of the machines, or if everything explodes in a ball of fire...
Re: Bubba3 downloads torrents to wrong user directory
Posted: 05 Mar 2011, 12:08
by AzP
It seems that it's actually possible to change uid, I just have to make sure I run chown on all the files again, so they get the new uid on them.
I think it's probably easier to change the uid on the bubba than my local computer...
Re: Bubba3 downloads torrents to wrong user directory
Posted: 05 Mar 2011, 12:08
by Cheeseboy
And you have the same uid for the same user on both machines?
Yes.
I never changed it on any of the bubbas, I always brought the situation to match the bubbas on other machines the network, just to be sure I would not have any nasty surprises.
The problem is that on Ubuntu for example, the first user your create will have uid/gui 1000:1000, the admin account on the B3 will have 1000/100.
Your first user created on the B3 will have uid 1001. So you create a new user on the Ubuntu system to be able to change your uid of the real login to 1001, but then that is already taken by the temp user you just created.
It is a pain, but after a few years you get a hang of it
Hmm, I hope that makes sense

Re: Bubba3 downloads torrents to wrong user directory
Posted: 05 Mar 2011, 12:32
by AzP
Hehe yeah, I guess you have to think about that when using NFS. I've been a Gentoo-user since 2002, but I've never had to think about the uid/guid issues. Good to learn at some point!
I'm glad to say that changing the uid on the bubba seems to have worked perfectly. I'm going to run some tests on the web-interface, etc, to see that I haven't broken anything.
Admin has uid 1001 now, but is still a member of the admin groud (with guid 100). Peter has uid 1000, but is still in group 1000 (users).
Thank you for your help!
Re: Bubba3 downloads torrents to wrong user directory
Posted: 05 Mar 2011, 12:47
by AzP
Yaaay now it works! Any tips for scripts so I can fix automatic downloading via rss and automatic unzip/unrar when the files are done?
Re: Bubba3 downloads torrents to wrong user directory
Posted: 05 Mar 2011, 13:11
by Cheeseboy
Any tips for scripts so I can fix automatic downloading via rss and automatic unzip/unrar when the files are done?
Nope, I've been thinking about that myself, but as there doesn't seem to be a standard on how things are packaged, the script would become overly complex. But... If it is video you are thinking about there is always this:
http://forum.excito.net/viewtopic.php?f ... 75&start=0
No need to unrar it...

Re: Bubba3 downloads torrents to wrong user directory
Posted: 30 Jun 2011, 15:22
by AzP
I've written the script myself now and it seems to work well. I just haven't decided on the final touches, should I run it as a service, or just by hand and then let it run in a 'screen' session?
I'd also probably want it to automatically check if the settings has been changed every now and then (or when they are changed) instead of having to restart the script every time. I guess the latter is ok if I run it as a service (just do service rsstorrent restart), but not using screen.