Jump to content

How do I allow Emby write permissions in FreeNas.


WingraMax

Recommended Posts

WingraMax

Hello,

I'm not sure where to post this, so here it is.

 

I was ale to get Emby 4.2.0.5 running on Freenas 11.2. After a little messing around with the new version I realized that my log file was spitting out errors when I would try to tag specific movies that the automated tagger didn't grab. It would tell me that it didn't have permission to write the file, and I understand why. My emby jail doesn't have write permission, and I am wondering how to set that up. I have spent awhile looking for others who have had similar issues or ANY documentation on how to add write privileges to emby in freenas but have come up empty handed.

 

Thanks!

Link to comment
Share on other sites

makarai

So this is how i do it its easy and works quite well.

 

I assume you mounted your dataset into emby using the GUI? This data set has an owner attached to it. So the first thing i would do is find out what that owner is (its id) i would do it with the following.

 

Log into the emby jail and go to the location where you mounted your media files.

 

For me that is the root path / and find out

cd /

Now you find out what user has access to the data with 

ls -la

and what the id is of that user (my data is owned by the user id 1101) 

id (user)

So my data is owend by user 1101 and emby runs typically with user id 989.

 

Now you just change the userid of the emby server to the one that your data set is mounted as (for me again 1101)

service emby-server stop
pw groupmod emby -n emby -g 1101
pw usermod emby -n emby -u 1101 -g 1101
chown -R emby:emby /var/db/emby(hit tab)
sysrc 'emby_server_user=emby'
service emby-server start

after that you go into your root folder and check again if everything is properly set.

 

5cdd22aab80ac_01.png

Edited by makarai
  • Like 2
Link to comment
Share on other sites

  • 2 weeks later...
strugglez

I figured I would post in this thread as the goal is somewhat similar if not identical to what I am experiencing issues with currently.

 

I want most if not all of my plugins to share the same UID and GID of System/Admin. I am having difficulty with emby actually starting when I change the below.

emby_server_user=System
emby_server_group=Admin

from

emby_server_user=emby
emby_server_group=emby

EDIT: Nevermind, managed to resolve

I replaced the below to System:Admin and everything started to startup fine.

 

chown -R emby:emby /var/db/emby(hit tab

Edited by strugglez
Link to comment
Share on other sites

I figured I would post in this thread as the goal is somewhat similar if not identical to what I am experiencing issues with currently.

 

I want most if not all of my plugins to share the same UID and GID of System/Admin. I am having difficulty with emby actually starting when I change the below.

emby_server_user=System
emby_server_group=Admin

from

emby_server_user=emby
emby_server_group=emby

EDIT: Nevermind, managed to resolve

I replaced the below to System:Admin and everything started to startup fine.

 

Thanks for following up. Glad you figured it out.

Link to comment
Share on other sites

  • 3 months later...

I think I've got the same problem. Is there any other way except running the jail as the user owning the mounted folders? My folders are owned by root and I would think its not the cleverest idea to run the jail as root.

 

 

This is my setup:

All datasets containing media files or samba shares are owned by root and the owning group name is "highsec" or "lowsec.

Rights are set to chmod 774.

I've got an unix user account "highsec" which has no home folder and isn't allowed to login and to that user is my Windows admin account assigned to. User "highsec" is member of the groups "highsec" and "lowsec".

I've got another unix user "lowsec" which is only member of group "lowsec" and my unprivileged Windows user is assigned to that unix user.

 

My idea was that only my Windows Admin User is allowed to access samba shares owned by group highsec and multiple unprivileged users assigned to group "lowsec" are allowed to use alle the other shares.

 

I tried to add the uid of the "emby" jail user (989) to my host systems "highsec" and "lowsec" groups but that doesn't worked.

 

Any ideas how to change the rights so the isolation of the jails isn't totally screwed up?

Link to comment
Share on other sites

Emby can now create nfos in the shared media folders.

 

I kept the groups "highsec" and "lowsec" but changed the user to "nobody" für all non-media shared pools and a new user "emby" for all media pools. I also added user "emby" to "highsec" and "lowsec".

 

Then I loghed in into the emby jail and used this...

service emby-server stop
pw usermod emby -n emby -u 89
chown -R emby:emby /var/db/emby-server/
sysrc 'emby_server_user=emby'
service emby-server start

...to change the uid of the jails "emby" user to the uid of the hosts "emby" user. I kept the jails "emby" group. Could that be a problem? Should I change the gid of the jail to?

Link to comment
Share on other sites

makarai

As far as i read it, my post above covers the problems mentioned here.

 

Dunin probably needs to check that the id for emby in the jail is the id for the host machine for the user that owns the data sets. I suppose he added the media data sets via the GUI and did not attach the jail via NSF or Samba?

Link to comment
Share on other sites

Yes I added the media folders to the jail via gui (Jails -> emby -> Mountpoints -> Add). So the uid was different so I changed it inside the jail to the uid of the media folder owner of the freenas host system. Now emby is the owner of the mounted folders, so write permissions are working. But I didn't changed the gid inside the jail, because I need two different groups for my media folders so I can limit samba access to different user privileges.

 

What should I do with the group permissions now, so I don't run into problems when emby and samba users share the same folders but create files with different groups.

 

Edit:

Could setting the setuid bit be a solution? What if I change alle media folders to chmod 2770? Shouldn't that do that all files emby creates inside the jails are owned by the group of the mounted folder, so it is not important what group emby normally uses?

Edited by Dunuin
Link to comment
Share on other sites

Please, can you include outputs of ls -la every time you change anything... Its hard to keep up.

So right now its like this? emby:"don't know which group should own it" rwx-r-x-r-x?

Edited by Duffyx
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...