PLEX via Docker - .config on Storage Not System

    • OMV 4.x
    • PLEX via Docker - .config on Storage Not System

      I have linuxserver/plex container installed and running. Thanks to @flvinny521

      My preference is to have my /.config/ directory on my storage volumes rather than my boot volume as it is a smallish USB stick. I will place my collected data here.

      What can I do to get my active Docker configuration files to exist on my storage volumes?

      Thank you,
      Jerry

      This works:

      This does not work(Wish it did):


      Other info:
      root@OMVi3:~# ls -lah /home/docker/.config/plex/
      total 104K
      drwxr-xr-x 6 docker users 4.0K Mar 17 22:58 .
      drwxr-xr-x 13 docker docker 4.0K Mar 19 07:52 ..
      drwxr-xr-x 2 docker users 4.0K Mar 17 22:41 backups
      drwxr-xr-x 2 docker users 4.0K Mar 17 22:41 cache
      -rw-r--r-- 1 docker users 14K Mar 17 22:42 config.ini
      drwxr-xr-x 3 docker users 4.0K Mar 17 22:58 Library
      drwxr-xr-x 2 docker users 4.0K Mar 17 22:41 logs
      -rw-r--r-- 1 docker users 56K Mar 17 22:41 plexpy.db
      -rw-r--r-- 1 docker users 40 Mar 17 22:41 version.lock
      root@OMVi3:~# du -sh /home/docker/.config/plex/*
      4.0K /home/docker/.config/plex/backups
      4.0K /home/docker/.config/plex/cache
      16K /home/docker/.config/plex/config.ini
      450M /home/docker/.config/plex/Library
      8.0K /home/docker/.config/plex/logs
      60K /home/docker/.config/plex/plexpy.db
      4.0K /home/docker/.config/plex/version.lock
      root@OMVi3:~# ls -lah /sharedfolders/whale/.config/plex/
      total 12K
      drwxrwxrwx+ 3 docker users 4.0K Mar 20 08:19 .
      drwxrwxrwx+ 13 docker users 4.0K Mar 19 11:00 ..
      drwxrwxrwx+ 3 docker users 4.0K Mar 20 08:19 Library
      root@OMVi3:~# du -sh /sharedfolders/whale/.config/plex/*
      312K /sharedfolders/whale/.config/plex/Library


      Other settings:
      OMV 4.x on intel

      The post was edited 1 time, last by ajaja ().

    • The paths where created the same way; choosing the path not typing them in.
      There are no obvious error messages. Where would I look for them?

      When I chose /sharedfoldes/whale/.config/plex — /sharedfolders/whale/.config/plex/Library/ — is created by Plex container, when it is run.
      OMV 4.x on intel

      The post was edited 1 time, last by ajaja ().

    • ajaja wrote:

      The paths where created the same way; choosing the path not typing them in.
      There are no obvious error messages. Where would I look for them?

      When I chose /sharedfoldes/whale/.config/plex — /sharedfolders/whale/.config/plex/Library/ — is created by Plex container, when it is run.
      You can look in the Log for the container, it is available in the Docker GUI.

      OK, some more questions.

      You have set PGIG 100 and PUID 1001. Are those real existing users on your system or did you read about using those somewhere and just put them in? Look in the Log to see what user and group the container is running as.

      What is the ownership and permissions on the storage drive(s) you are trying to write these items to?
      OMV 4.x - ASRock Rack C2550D4I - 16GB ECC - Silverstone DS380
    • raulfg3 wrote:

      my working plex config:
      r3, I am trying to get my /.conf off the boot drive. Your working looks much like my working.


      gderf wrote:

      You have set PGIG 100 and PUID 1001. Are those real existing users on your system or did you read about using those somewhere and just put them in?
      My Docker UID is 1001. My Users GID is 100.
      root@OMVi3:~# id docker
      uid=1001(docker) gid=100(users) groups=100(users),996(docker)


      The only change I made from working state to broken state is the pointer to the .config directory.

      This is from the container log via the Docker GUI:
      #####################################################
      # Login via the webui at http://<ip>:32400/web #
      # and restart the docker, because there was no #
      # preference file found, possibly first startup. #
      #####################################################


      I suspect it is the + in the folder permissions, but I do not know what the + is. Something to do with ACLs?
      drwxr-xr-x 3 docker users 4.0K Mar 17 22:58 Library(working)
      drwxrwxrwx+ 3 docker users 4.0K Mar 20 08:19 Library(broken)
      OMV 4.x on intel

      The post was edited 1 time, last by ajaja ().

    • gderf wrote:

      Try this. Instead of pointing /config to /sharedfolders/whale/.config/plex navigate to the actual drive mountpoint instead.
      Like so: /srv/7911fa44-a322-442c-a434-6c2ad2f3b1ff/whale/.config/plex/ ?

      This is wat I got:
      ####################################################
      # Login via the webui at http://<ip>:32400/web #
      # and restart the docker, because there was no #
      # preference file found, possibly first startup. #
      #####################################################
      OMV 4.x on intel
    • Absolutely. But for Plex that really isn't a docker config file that would normally be named .config. It's the location of of the Plex Media Server Database. I have mine here:

      /srv/dev-disk-by-label-dp1/plexmediaserver-dockered

      There is or will be one folder in there - Library.
      OMV 4.x - ASRock Rack C2550D4I - 16GB ECC - Silverstone DS380
    • gderf wrote:

      Absolutely. But for Plex that really isn't a docker config file that would normally be named .config. It's the location of of the Plex Media Server Database. I have mine here:

      /srv/dev-disk-by-label-dp1/plexmediaserver-dockered

      There is or will be one folder in there - Library.
      I am not sure what you are suggesting.

      /.config/plex is a directory I created. The container has /config as a perimeter.
      From linuxserver/plex /config - Plex library location. This can grow very large, 50gb+

      The container populates /home/docker/.config/plex/ with the following:
      backups/
      cache/
      config.ini
      Library/
      logs/
      plexpy.db
      version.lock

      This all works fine if I create /.config/plex in the /home/docker/, but when I create /.config/plex on the data drive the container does not populate it fully.
      Do you think it may have to do with permissions?




      # ls -lah /home/docker/.config/plex/Library/Application\ Support/Plex\ Media\ Server/
      drwxr-xr-x 11 docker docker 4.0K Mar 21 20:07 .
      drwxr-xr-x 3 docker docker 4.0K Mar 17 22:58 ..
      drwxr-xr-x 3 docker docker 4.0K Mar 21 18:59 Cache
      drwxr-xr-x 3 docker docker 4.0K Mar 20 19:58 Codecs
      drwxr-xr-x 4 docker docker 4.0K Mar 20 19:57 Crash Reports
      drwxr-xr-x 3 docker docker 4.0K Mar 21 19:10 Logs
      drwxr-xr-x 3 docker docker 4.0K Mar 18 13:58 Media
      drwxr-xr-x 4 docker docker 4.0K Mar 18 14:04 Metadata
      -rw-r--r-- 1 docker users 3 Mar 21 13:07 plexmediaserver.pid
      drwxr-xr-x 3 docker docker 4.0K Mar 17 22:59 Plug-ins
      drwxr-xr-x 7 docker docker 4.0K Mar 17 22:58 Plug-in Support
      -rw------- 1 docker users 1.4K Mar 21 20:07 Preferences.xml
      drwxr-xr-x 3 docker users 4.0K Mar 18 21:41 Thumbnails


      # ls -lah /sharedfolders/whale/.config/plex/Library/Application\ Support/Plex\ Media\ Server/
      drwxrwxrwx+ 6 docker users 4.0K Mar 21 13:05 .
      drwxrwxrwx+ 3 docker users 4.0K Mar 20 08:19 ..
      drwxrwxrwx+ 3 docker users 4.0K Mar 20 08:19 Codecs
      drwxrwxrwx+ 3 docker users 4.0K Mar 20 08:19 Crash Reports
      drwxrwxrwx+ 2 docker users 4.0K Mar 21 13:05 Logs
      drwxrwxrwx+ 3 docker users 4.0K Mar 20 08:19 Plug-in Support
      OMV 4.x on intel
    • I am saying that .config is really a misnomer for the directory name. In a standard install it would not be a name preceded with a dot, nor would it be called config. It really is not a docker configuration file, it's the PMS metadata database.

      Whatever you call that directory, it must be owned by the user and group that PMS is running as.
      OMV 4.x - ASRock Rack C2550D4I - 16GB ECC - Silverstone DS380
    • fred:users is the user:group that all my dockers run as and their configurations set these as PUID and PGID with the numerical equivalents for the user and group.

      The folowing are directories on one of several 3TB disks I have:
      drwxr-sr-x 3 fred users 4096 Mar 12 16:02 plexmediaserver-dockered (This is the Plex Media Server Database. /config in the docker container path points here)
      drwxr-sr-x 3 fred users 4096 Mar 22 10:17 plexmediaserver-transcode (This is where transcode temp files are written to by the PMS docker. /transcode in the docker container path points here)

      The following is one of several mergerfs mountpoints that exist on one of the 3TB disks. The actual data is spread out over a pool 4x 3TB disks:
      drwxr-sr-x 2370 fred users 126976 Mar 21 20:50 movies (This is a mergerfs pool mountpoint for movies. /data/movies in the docker container path points here)

      All my media directories and files are owned by fred:users (movies, music, tv-series) and have permissions of 2755. All the files within those directories have permissions of 0644.
      OMV 4.x - ASRock Rack C2550D4I - 16GB ECC - Silverstone DS380
    • ajaja wrote:

      I am led to think the + has something to do with it.
      That means there are ACLs set.

      ajaja wrote:

      I am led to wonder about the s
      That is the group sticky bit meaning anything created in that folder will be owned by the same group as the folder.
      omv 4.1.8.2 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.9
      omv-extras.org plugins source code and issue tracker - github.com/OpenMediaVault-Plugin-Developers

      Please read this before posting a question.
      Please don't PM for support... Too many PMs!
    • Well this(OMV) has been a learning experience for me. I do appreciate the help I get here. Tricky to ask questions when I am limited in understanding the subject. This is my first venture into Docker. I have been doing my learning on my secondary server. It will be a week before I come back to that computer.
      In the meantime I realize that my primary server has a 220GB M.2 boot drive. I am thinking it best to keep Docker and PLEX needs on that big fast drive. Which I got up and running last night. My next adventure will be setting-up haugene/transmission-openvpn. This is overwhelming for me as I know little about OpenVPN(VPN for that matter), Docker, and Transmission with hopes of having it dance with Sonarr. So expect a bunch of questions there.

      Thanks,
      Jerry
      OMV 4.x on intel
    • ajaja wrote:

      Could this have anything to do with my data volume being a UnionFS mount?
      Possibly but it seems like an ACL problem (I don't like them). It seems like your setup is failing when ACLs are in place. Try removing those.
      omv 4.1.8.2 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.9
      omv-extras.org plugins source code and issue tracker - github.com/OpenMediaVault-Plugin-Developers

      Please read this before posting a question.
      Please don't PM for support... Too many PMs!
    • @ajaja

      PMS is your first docker image? Gratulation? PMS was my fourth docker image and it was the hardest to get it to run.
      There're some things you have to do.
      First check in the fstab file (via ssh to your server => nano /etc/fstab) and remove the "noexec" command from your mounted drive where you want to store the config files. Why? You can't watch any videos via Browser over the internet because Plex can't use his codec folder. Don't know why here I found the solution.
      I also have created a Config-Dir on the second partition of my system drive (512GB SSD - first I've installed Debian Stretch and partitioned it while installation, afterwards I've installed OMV over it). With
      chmod -R 777 /sharedfolder/Folder-of-config/PMS-configs
      and
      chown -R dockeruser:user /sharedfolders/Folder-of-config/PMS-configs
      I changed permissions. My username for Docker is "Wuzzi" which has normal user rights and also rights to write/read to the shared smb-folders which contain my data.

      Another tricky point is the iGPU-transcoding (hardware transcoding of the intel GPU). To get it run you have to pass through the GPU to your docker. With the command under "extra-args"

      --device=/dev/dri

      you can do that trick. BUT! There's another problem to solve. You have to change permissions of /dev/dri to the dockeruser too (in my case: Wuzzi:users). But here it's very tricky because when you change permissions, after reboot the old settings are back (root:root). How to solve this? With a script under /usr/local/bin and the name permissions.sh. That's my script (for the intel GPU and my DVB-S cards)


      Shell-Script

      1. #!/bin/sh
      2. chown -R Wuzzi:users /dev/dvb/adapter0
      3. chown -R Wuzzi:users /dev/dvb/adapter1
      4. chown -R Wuzzi:users /dev/dvb/adapter2
      5. chown -R Wuzzi:users /dev/dvb/adapter3
      6. sleep 1
      7. chmod -R 666 /dev/dvb/adapter0
      8. chmod -R 666 /dev/dvb/adapter1
      9. chmod -R 666 /dev/dvb/adapter2
      10. chmod -R 666 /dev/dvb/adapter3
      11. sleep 1
      12. chown -R Wuzzi:users /dev/dri/card0
      13. chown -R Wuzzi:users /dev/dri/renderD128
      14. sleep 1
      15. chmod -R 666 /dev/dri/card0
      16. chmod -R 666 /dev/dri/renderD128
      17. sleep 1
      18. exit 0
      Display All

      and with
      chmod a+x /usr/local/bin/permissions.sh
      you make it executable.
      But that's not all. Under /etc/systemd/system I've created the following service-script with: nano set-permissions.service


      Source Code

      1. [Unit]
      2. After=network.target
      3. [Service]
      4. ExecStart=/usr/local/bin/permissions.sh
      5. [Install]
      6. WantedBy=multi-user.target
      and with the command


      systemctl enable set-permissions.service

      and after a reboot of the server this service runs in the background. After every reboot/hibernate/standby/power on the above script is executed and the permissions are set.

      With the next posting you can see my docker settings...
      OMV-Server-HW: MoBo Fujitsu D3417-B2 (Intel-LAN), Intel Xeon E3-1245 v6 Kaby Lake (4x3.70GHz), 16GB-Ram ECC UDIMM, 1x512GB SSD Samsung 850 Pro (sda2 - 30GB system, 4GB swap, sda5/rest - for work), 4x3TB WD Red's Snapraid w/ mergerfs, 2x DVB-S2 card DVBSky s952v3,

      OMV-Server-SW: Debian Stretch with 4.15.x-Backports-Kernel (always up-to-date), OMV 4.1.x (always latest), omv-extras-plugin (always latests), AutoShutdown-Plugin, Virtualbox (with DSM 6.1.x), PlexMediaServer, SMB-Shares, TVHeadendServer (unstable release)

      BackupServer: Synology DS1010+ with 4GB Ram, 9TB@SHR (different hdd's), DSM 5.2-5967-2