Using Logitech Media Server on FreeNAS

arrowd

Dabbler
Joined
Jul 12, 2019
Messages
16
This may be a newbie question because that describes me: I'm having trouble accessing music files from a Logitech Media Server (LMS) running in a jail on FreeNAS. The music files are SMB shared files hosted on the same FreeNAS. The Music directory is a child dataset of the main pool dataset rather than just a directory inside the main pool dataset. (I did this because I want to set up snapshots of different sections of the main dataset and run them at different times with different retentions.) Both LMS and FreeNAS are running fine except for this glitch.

I have tried to follow instructions on creating a mount point for the music files that would be visible inside the jail using these instructions:
https://www.ixsystems.com/documentation/freenas/11.2/jails.html#additional-storage

Per those instructions, from inside the jail, I checked /etc/group and the last line is
slimserv:*:104:
Inside /etc/passwd the last line is
slimserv:*:104:104:Slim Devices SlimServer pseudo-user:/nonexistent:/usr/sbin/nologin
I added a slimserv user to FreeNAS and added it to group wheel.

The mount point in the jail looks like this:
Source: /mnt/pool1/Music
Destination: /mnt/pool1/iocage/jails/LMS/root/Music

Doing a 'ls -l' from a shell inside the jail and from a shell in FreeNAS includes:
drwxrwx---+ 316 1000 wheel 317 Sep 22 19:20 Music
I think the '+' means that there is an ACL on this and here's what getfacl from a FreeNAS shell shows:
# file: Music
# owner: don
# group: wheel
owner@:rwxpDdaARWcCos:fd-----:allow
group@:rwxpDdaARWcCos:fd-----:allow
everyone@:--------------:fd-----:allow
From a shell inside the jail it looks the same except that the owner is '1000'.

THE PROBLEM: When I look at settings from the web interface for LMS and try to pick the music file location, hitting browse brings a list of directories that matches what I see via a shell on the jail but the LMS web browse window doesn't include Music.

I'm guessing that directories without the correct permissions are not included in the browse listing in LMS. I can say that when I made another mount point as a test, it wasn't visible, but if I then deleted that mount point, then the name showed up as a normal directory inside the jail area and was visible in the LMS web browse window.

There doesn't seem to be a way to set the LMS running user. And there doesn't seem to be a way to specify the permissions on the datasets. If I could somehow make 'other'/'everyone' have 'rwx' or 'r-x' access, would that work?

Thanks for any help.
 

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288
@arrowd Owner shows as "1000" in jail as user "don" does not exist in the the jail so you only see a numeric user id in file listings. It looks like you are using the latest FreeNAS 11.2-U6 which has made a change to the default ACL on new ‘Windows’ datasets. See here: https://www.ixsystems.com/blog/library/freenas-11-2-u6/

If so, use the setfacl command in the release notes to restore the previous default behavour and then the slimserver user should see your "Music" folder in the jail.
 

arrowd

Dabbler
Joined
Jul 12, 2019
Messages
16
Thanks so much - this is definitely the reason for my problem. Doing this on the Music dataset makes it appear but it has no content. If I then do the setfacl on a directory inside, then I can see that but not its contents, etc. There doesn't seem to be a way to apply this to the existing 40GB of files I already have on the dataset. Linux setfacl appears to have a -R switch but FreeBSD setfacl doesn't. Do you have a suggestion for doing this recursively?
 

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288
A variation of this should sort you out: https://docs.j7k6.org/freenas-remove-acls-recursively/

P.S. Another soultion would have been to create a slimserver group on the FreeNAS host with a gid of 104 and add the user "don" to that group and
set the goup onwership on the FreeNAS music dataset to the "slimserver" group you created. But his may not be compatilbe with how you want the SMB share on the music dataset to work.
 
Last edited:

arrowd

Dabbler
Joined
Jul 12, 2019
Messages
16
KrisBee - thanks so much - all is working great now. For anyone faced with the same problem, these are the two commands I entered from the Music directory:
find . -type d -print -exec setfacl -m everyone@:rxaRc:fd:allow {} \;
find . -type f -print -exec setfacl -m everyone@:rxaRc:I:allow {} \;
 

RandomBloke85

Dabbler
Joined
May 22, 2021
Messages
23
Just wanted to say thanks!

Had exactly the same problem with Truenas 12.2 and the 2 lines in post #5 did the trick. Of course, I have no clue what this means, but it works. :smile:
 
Top