Can't delete Syncthing/Plex files via web player or Roku

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
Post Reply
Posts: 3
Joined: Thu Aug 01, 2019 5:15 am

Can't delete Syncthing/Plex files via web player or Roku

Post by bigmanblacktshirt »

Raspberry Pi 3, installed both Plex Media Server and Syncthing via DietPi and they work well.

The other end of my Syncthing system sends tv shows over to the Pi and Plex Media Server serves them up perfectly. Only, after I watch them I can't delete them via a web player or my Roku.

In the DietPi's PMS TV Shows folder, synced via Syncthing the folder and video file have the following permissions and user/group:

tvshow-folder drwxr-xr-x dietpi dietpi
tvshow-file -rw-r--r-- dietpi dietpi

If I chmod the folder and video file to 777 I can delete the file via web player or Roku. But the next time a TV show is synced over to the Pi, the same permissions and user/group is assigned, creating the same deletion problem.

Looking at top I see that PMS runs as user "plex" and Syncthing runs as user "dietpi".

I need to either have all Syncthing synced files have looser file permissions or I need to change (I think?) Syncthing to run as user "plex"?

Any ideas?

User avatar
Site Admin
Posts: 2293
Joined: Sat Nov 18, 2017 6:21 pm

Re: Can't delete Syncthing/Plex files via web player or Roku

Post by MichaIng »

Plex runs as dietpi group and the user itself is as well part of the dietpi group. So as long as dirs/files have 775/664, it will be able to write files as well.
Are there cases where Plex creates files or dirs? If so we could set UMask=002 for it's systemd unit to have it creating with above permissions. I hope then that this is forwarded to the child processes as well.

Your issue is that Syncthing does not create content with 775/664 permissions. That could be changed:
nano /etc/systemd/system/syncthing.service
below User=dietpi add UMask=002, then
systemctl daemon-reload
systemctl restart syncthing

I am not too familiar with Syncthing, but is it expected that it's data files are modified/removed outside the Syncthing GUI/clients? E.g. in case of ownCloud and Nextcloud this should not be done since those have an internal file cache/index stored in database that needs to match the actual files. So files from the servers data dir should never be edited outside of their web UIs or clients.
But perhaps Syncthing handles things differently.
Post Reply