I run plex on Ubuntu 16 sever and permissions restrictive on the media files generated by DVR

I am currently successfully running DVR however I have one problem.
I am running an external application on Windows 10 which automatically converts the format of the file, stores on the Ubuntu server and deletes the original copy.
The connection is SMB.
When the file is created by plex write permissions are set only for the user “plex”,
I get a “permission denied error on Windows 10 by the linux user”.

My problems would be solved if plex DVR code could set the user permissions to read/write for all users when creating the DVR media files and folders.

And known solutions to this Problem?

I have noticed this problem has been raised in many forums, and a long description of setting permissions has been recommended.
No solutions permanently fix the problem, which is core to plex DVR
`
regards Finnboat

I solve these types of issues by doing a few things…

First, I run Plex as a different user. I created a user (and group) just for this purpose. I then connect to the Plex server using that user. Also, I have SAMBA assign permissions.

In my example I have all of my hard drives mounted under the folder called “Plex”. All folders and files are owned by my plex user I created and the share looks like this:

[Plex]
path = /home/Plex
create mode = 664
writeable = yes

Thank you for your answer
Can you comment on the following.
I propose to run plex under my core user “smith”.
The ownership should be “Smith: Smith” and permissions rw rw rw.

I would use the following SAMBA configuration

[smith]
path = /home/smith
Create Mode = 664
Writable = yes

I only use the server has an application server for Plex so I do not think there will be conflict with other applications.

I would really appreciate your comment

finnboat

i am cautious about changing the user
will this method work and not loose my media information (

Stop plex if it is running

sudo service plexmediaserver stop

Edit the plexmediaserver file

sudo nano /etc/default/plexmediaserver
scroll down to
PLEX_MEDIA_SERVER_USER=plex ← change this to the username you want to use
save changes

Modify groups

sudo addgroup plex youruser
sudo addgroup youruser plex

then start plex again

sudo service plexmediaserver start

the user that PMS should run as, defaults to ‘plex’

note that if you change this you might need to move

the Application Support directory to not lose your

media library (match what is in /etc/passwd)

export PLEX_MEDIA_SERVER_USER=plex

My entire setup is a bit customized so I’ll do my best to document it here. Forgive me if I miss something since I’ve been making tweaks for many years…

First, I remap the default Plex Library to another drive. I do this for a couple reasons. First, my other drive is bigger and faster, and second, it is easy to keep permissions and ownship correct if ALL files are under the same folder.

I remap using fstab instead of the ‘official’ Plex directions.

# Plex Data Drive (WD Black - 3TB - SATA)
UUID=d2535989-0c38-41d6-8f2a-11533ceb0b21 /home/Plex/PlexData ext4 defaults 0

This mounts the faster hard drive and then

# Remap Plex Data to bigger and faster drive
/home/Plex/PlexData/ /var/lib/plexmediaserver none bind

This moves the default location for Plex files to the newly mounted hard drive

I also put all my data drives under this folder. Example:

# Internal Media Drives 
UUID=8fb19a47-26d6-444c-a809-c2a3117bfc28 /home/Plex/Media01 ext4 defaults 0 2 

I created a special user and group for Plex (call it what you like). I gave ownship to everything under /home/Plex to this user and group and assigned correct permissions (folders 755, files 644).

I did not modify /etc/default/plexmediaserver (this can be overwritten on upgrade if you are not careful).

Instead I created /etc/systemd/system/plexmediaserver.service.d/override.conf.

The contents of override.conf:

[Service]


User=youruser
Group=yourgroup

UMask=0002

I hope this helps. Sorry if it is a bit confusing and there’s no doubt better ways to do this but this was done over several years and since it works, I’m not fixing it. :smiley:

I attached plex architecture
interfaces in green work fin, its just when plex tries to write to a file on on ubuntu I get the non accessible message.
Do you use DVR ?

I do use the DVR but I do not modify the files outside Plex.

I used to do this when I used MythTV but I did it all on the Linux box.

As long as you are using the same username and passing the permissions in the Samba file it should not be an issue. If it is, you could always give your Plex user permission to read the files created by whatever user is creating them from Windows.

Or, better yet, manipulate the files in Linux and skip the whole Windoze nonsense. :smiley:

Hi
I solved my problem
i use the post processing feature of Plex to call HandbreakCLI in a script and dumped Windozer
see my modified architecture
thanks for your comments