BitTorrent Sync Initial Setup Permissions Problem

Status
Not open for further replies.

Alex Kirk

Cadet
Joined
Nov 16, 2015
Messages
6
Still a relative FreeNAS n00b, and one of the things I'm exploring is the BitTorrent Sync plugin (to keep a redundant copy of the data on my Drobo). I've attempted to follow the steps in this article:

http://blog.bittorrent.com/2014/02/...-freenas-with-bittorrent-sync-using-a-plugin/

Unfortunately when I get to the "Add a Folder" portion of the article - i.e. the very end - I get "Don't have permissions to write to selected folder" when choosing the pre-created "/media" folder in my jail, or "You do not have permission to write to this directory" if I attempt to create a new folder in the folder add dialog.

Looking at UNIX permissions inside the jail, things appear to be in good shape:

Code:
[akirk@freenas /mnt/Enterprise/Jails/btsync_1]$ ls -l
total 98
-r--r--r--  1 root  wheel  6197 Jul 10  2014 COPYRIGHT
drwxr-xr-x  2 root  wheel  46 Jul 10  2014 bin
drwxr-xr-x  7 root  wheel  40 Jul 10  2014 boot
dr-xr-xr-x  9 root  wheel  512 Nov 18 08:58 dev
drwxr-xr-x  21 root  wheel  104 Nov 18 08:58 etc
drwxr-xr-x  3 root  wheel  49 Jul 10  2014 lib
drwxr-xr-x  3 root  wheel  5 Apr  2  2015 libexec
drwxrwxr-x  2 btsync  btsync  2 Nov 17 14:54 media
drwxr-xr-x  2 root  wheel  2 Jul 10  2014 mnt
dr-xr-xr-x  1 root  wheel  0 Nov 18 09:07 proc
drwxr-xr-x  2 root  wheel  144 Jul 10  2014 rescue
drwxr-xr-x  2 root  wheel  6 Jul 10  2014 root
drwxr-xr-x  2 root  wheel  132 Jul 10  2014 sbin
lrwxr-xr-x  1 root  wheel  11 Jul 10  2014 sys -> usr/src/sys
drwxrwxrwt  6 root  wheel  6 Nov 18 08:58 tmp
drwxr-xr-x  15 root  wheel  15 Nov 18 08:58 usr
drwxr-xr-x  25 root  wheel  25 Nov 18 08:58 var


Looking at the permissions on /mnt/Enterprise/Jails via the Volume Manager shows a user of btsync and a group of btsync. The username that the initial setup said I couldn't change I just left as "btsync", though I am logging into the web interface for the plugin as "akirk".

Any idea what I've done wrong? Is the article now out of date and missing something crucial, or did I just miss a step somewhere?
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
can you run "ls -l /" and "ls -l /media" in the jail. I just want to make sure the btsync user UID matches.
 

Alex Kirk

Cadet
Joined
Nov 16, 2015
Messages
6
can you run "ls -l /" and "ls -l /media" in the jail. I just want to make sure the btsync user UID matches.
Just to be sure I do this right, since I'm familiar with the concept of jails, but never implemented one before - is there some shell command to swap myself into the jail I'd need to run first?
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Just to be sure I do this right, since I'm familiar with the concept of jails, but never implemented one before - is there some shell command to swap myself into the jail I'd need to run first?
"jls" to list your jails. "jexec # csh" to enter the desired jail
 

Alex Kirk

Cadet
Joined
Nov 16, 2015
Messages
6
Sorry for the delay, adjusting to a newborn at home...

Code:
akirk@freenas /mnt/Enterprise/Jails/btsync_1]$ sudo jexec 2 ls -l
Password:
total 220
-rw-r--r--  2 root  wheel  965 Jul 10  2014 .cshrc
drwxr-xr-x  2 root  wheel  4 Nov 18 08:58 .plugins
-rw-r--r--  2 root  wheel  253 Jul 10  2014 .profile
-r--r--r--  1 root  wheel  6197 Jul 10  2014 COPYRIGHT
drwxr-xr-x  2 root  wheel  46 Jul 10  2014 bin
drwxr-xr-x  7 root  wheel  40 Jul 10  2014 boot
dr-xr-xr-x  9 root  wheel  512 Nov 18 08:58 dev
drwxr-xr-x  21 root  wheel  104 Nov 18 08:58 etc
drwxr-xr-x  3 root  wheel  49 Jul 10  2014 lib
drwxr-xr-x  3 root  wheel  5 Apr  2  2015 libexec
drwxrwxr-x  2 1003  1003  2 Nov 17 14:54 media
drwxr-xr-x  2 root  wheel  2 Jul 10  2014 mnt
dr-xr-xr-x  1 root  wheel  0 Nov 18 15:58 proc
drwxr-xr-x  2 root  wheel  144 Jul 10  2014 rescue
drwxr-xr-x  2 root  wheel  6 Jul 10  2014 root
drwxr-xr-x  2 root  wheel  132 Jul 10  2014 sbin
lrwxr-xr-x  1 root  wheel  11 Jul 10  2014 sys -> usr/src/sys
drwxrwxrwt  6 root  wheel  6 Nov 18 08:58 tmp
drwxr-xr-x  15 root  wheel  15 Nov 18 08:58 usr
drwxr-xr-x  25 root  wheel  25 Nov 18 08:58 var
[akirk@freenas /mnt/Enterprise/Jails/btsync_1]$ sudo jexec 2 ls -l media
total 0
[akirk@freenas /mnt/Enterprise/Jails/btsync_1]$ grep 1003 /etc/passwd
btsync:*:1003:1003:BTSync:/nonexistent:/bin/csh


The man page for jexec is pretty sparse if you ask me - took me a bit to figure out the syntax (I expected to need to quote the commands being sent into the jail). Would I need to work with mainstream FreeBSD to propose some updates there?
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Sorry for the delay, adjusting to a newborn at home...

Code:
akirk@freenas /mnt/Enterprise/Jails/btsync_1]$ sudo jexec 2 ls -l
Password:
total 220
-rw-r--r--  2 root  wheel  965 Jul 10  2014 .cshrc
drwxr-xr-x  2 root  wheel  4 Nov 18 08:58 .plugins
-rw-r--r--  2 root  wheel  253 Jul 10  2014 .profile
-r--r--r--  1 root  wheel  6197 Jul 10  2014 COPYRIGHT
drwxr-xr-x  2 root  wheel  46 Jul 10  2014 bin
drwxr-xr-x  7 root  wheel  40 Jul 10  2014 boot
dr-xr-xr-x  9 root  wheel  512 Nov 18 08:58 dev
drwxr-xr-x  21 root  wheel  104 Nov 18 08:58 etc
drwxr-xr-x  3 root  wheel  49 Jul 10  2014 lib
drwxr-xr-x  3 root  wheel  5 Apr  2  2015 libexec
drwxrwxr-x  2 1003  1003  2 Nov 17 14:54 media
drwxr-xr-x  2 root  wheel  2 Jul 10  2014 mnt
dr-xr-xr-x  1 root  wheel  0 Nov 18 15:58 proc
drwxr-xr-x  2 root  wheel  144 Jul 10  2014 rescue
drwxr-xr-x  2 root  wheel  6 Jul 10  2014 root
drwxr-xr-x  2 root  wheel  132 Jul 10  2014 sbin
lrwxr-xr-x  1 root  wheel  11 Jul 10  2014 sys -> usr/src/sys
drwxrwxrwt  6 root  wheel  6 Nov 18 08:58 tmp
drwxr-xr-x  15 root  wheel  15 Nov 18 08:58 usr
drwxr-xr-x  25 root  wheel  25 Nov 18 08:58 var
[akirk@freenas /mnt/Enterprise/Jails/btsync_1]$ sudo jexec 2 ls -l media
total 0
[akirk@freenas /mnt/Enterprise/Jails/btsync_1]$ grep 1003 /etc/passwd
btsync:*:1003:1003:BTSync:/nonexistent:/bin/csh


The man page for jexec is pretty sparse if you ask me - took me a bit to figure out the syntax (I expected to need to quote the commands being sent into the jail). Would I need to work with mainstream FreeBSD to propose some updates there?
propose updates to the freebsd docs? I'm not sure what you are asking.

Though I see what is causing your issue. The 'btsync' user you created in the freenas userland doesn't have a matching UID with the 'btsync' user in the jail. The "Facts" section here may be helpful https://forums.freenas.org/index.ph...plugins-write-permissions-to-your-data.27273/
 

Alex Kirk

Cadet
Joined
Nov 16, 2015
Messages
6
Got things fixed with the help of the article you've linked here - specifically Solution 2, for the record. Thanks much!

What I'm asking in regards to the docs is what the process is for submitting proposed updates to the content of "man jexec", which is all of 36 lines long and doesn't give so much as a single working example of a complex argument you want to pass into the jail environment. I'd like to add some of that myself as I go along with this system anyway, the community might as well benefit from my work, no?

Oh, and out of curiosity, what part of Sac? I grew up in Antelope and have friends scattered all across town these days.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Got things fixed with the help of the article you've linked here - specifically Solution 2, for the record. Thanks much!

What I'm asking in regards to the docs is what the process is for submitting proposed updates to the content of "man jexec", which is all of 36 lines long and doesn't give so much as a single working example of a complex argument you want to pass into the jail environment. I'd like to add some of that myself as I go along with this system anyway, the community might as well benefit from my work, no?

Oh, and out of curiosity, what part of Sac? I grew up in Antelope and have friends scattered all across town these days.
glad you got i working

I've never contributed to the freebsd docs, but maybe you use bugs.freebsd.org.

I'm in Rosemont currently, south of highway 50. I'm not too far from antelope I believe.
 
Status
Not open for further replies.
Top