Hardware transcoding on Qnap TVS-672XT

drw------- 2 admin administrators 80 2020-09-30 20:32 dri/

It looks like after a reboot the permissions were changed back from the 777. So, as you suggested I implemented the udev method above within the container, but I don’t have a video group on the NAS core system. I then manually created the video group, and I could change /dev/dri to admin:video, but I believe it will be changed back to admin:administrators after reboot. How can I make the device permissions sticky in the video group for /dev/dri and the devices within?

Here’s how you fix the /dev/dri permissions issue on a QNAP when using docker:

Enable autorun.sh
https://forum.qnap.com/viewtopic.php?f=45&t=130345

vim /share/CACHEDEV1_DATA/.system/autorun/scripts/010-plex-dri.sh

(or whatever your path was created above).

add:

#!/bin/bash
chmod ug+rwX -R /dev/dri
chgrp -R video /dev/dri

Make executable:

chmod +x /share/CACHEDEV1_DATA/.system/autorun/scripts/010-plex-dri.sh

Reboot the NAS and test. This works with a docker container and should with the qpkg as well.

Point of order here.

  1. Plex runs as user admin:admin (numerical 0:0) which is root:root
  2. On QNAP, running the native PMS app, NO permissions are required because root doesn’t need any.

The above script DOES NOT APPLY to the native package.

Yes, the permissions are:

[~] # cd /dev/dri
[/dev/dri] # ls -la
total 0
drwxr-xr-x  2 admin administrators       80 2020-09-26 13:43 ./
drwxr-xr-x 18 admin administrators    22300 2020-10-01 00:00 ../
crw-------  1 admin administrators 226,   0 2020-09-26 13:43 card0
crw-------  1 admin administrators 226, 128 2020-09-26 13:43 renderD128
[/dev/dri] # ps -ef | grep -i plex
 3354 admin      2704 S   Plex EAE Service
 4468 admin     55956 S N Plex Plug-in [com.plexapp.system] /share/CACHEDEV3_DATA/.qpkg/PlexMediaServer/Resources/Plug-ins-b1b651549/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.20.2.3370-b1b651549 /share/CACHEDEV3_DATA/.qpkg/PlexMediaServer/Resources/Plug-ins-b1b651549/System.bundle
10442 admin       964 R   grep -i plex
30574 admin    227444 S   ./Plex Media Server
30969 admin      5976 S   /share/CACHEDEV3_DATA/.qpkg/PlexMediaServer/Plex Tuner Service /share/CACHEDEV3_DATA/.qpkg/PlexMediaServer/Resources/Tuner/Private /share/CACHEDEV3_DATA/.qpkg/PlexMediaServer/Resources/Tuner/Shared 1.20.2.3370-b1b651549 32600 /waitmutex
[/dev/dri] # 

Again, IT DOES NOT MATTER because Plex runs as admin (as shown above)

To run in docker (Container Station), Set PUID=0 and PGID=0

and you will not get the default UID=1000, PGID=1000

Recommendation: Fix the container definition, not change the core system.

I changed my container per suggestions above, thanks for the tip ChuckPa! There’s no reason it can’t run as root as far as I can tell.

This is the best implementation IMHO. Easy to run as root, and keeps things secure in the container vs running as root on the QNAP system device via the qpkg. Given Plex doesn’t even have basic two-factor authentication, I want to keep Plex in a container where it’s isolated from the system.

The reason it can’t run as unprivileged or without modifying /dev/dri at startup is because QNAP didn’t give us udev.

If they had, I could write the /etc/udev/rules.d files to lower the privilege level to user plex just as I do on all the other NAS platforms and on Linux desktops.

This , and one other, are the two exceptions in the fleet we’re deployed on.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.