Plex wont play movies

    • OMV 1.0
    • Resolved
    • There are some issues in their package.

      I install their latest plexmediaserver version 1840. Then after install I purge. The plex user still exists and the /var/lib/plexmediaserver folder. This is without any changes. Just straight install and then purge. So the library folder is not deleting either. When I did the locate before I used plexmediaserver.service, that is why I didn't notice this. Maybe this is to protect the database and users have to delete manually. I don't know.
    • Why do they include the default file in the package if they don't use it?? That is really stupid. I know it worked on Wheezy because the init script specifically called it. The unit file should call it as well. I have no problem with the plex user being left but I didn't want the unit file left when the service was not there.

      Their unit and default files should look like this (the default file could be moved to a .conf file somewhere in /etc too):

      Source Code

      1. [Unit]
      2. Description=Plex Media Server for Linux
      3. After=network.target
      4. [Service]
      5. EnvironmentFile=/etc/default/plexmediaserver
      6. ExecStartPre=/bin/sh -c '/usr/bin/test -d "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" || /bin/mkdir -p "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}"'
      7. ExecStart=/bin/sh -c '/usr/lib/plexmediaserver/Plex\ Media\ Server'
      8. Type=simple
      9. User=plex
      10. Group=plex
      11. Restart=on-failure
      12. RestartSec=5
      13. StartLimitInterval=60s
      14. StartLimitBurst=3
      15. [Install]
      16. WantedBy=multi-user.target
      Display All


      And then the default file should look like this:

      Source Code

      1. # default script for Plex Media Server
      2. # the number of plugins that can run at the same time
      3. PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS=6
      4. # ulimit -s $PLEX_MEDIA_SERVER_MAX_STACK_SIZE
      5. PLEX_MEDIA_SERVER_MAX_STACK_SIZE=3000
      6. # where the mediaserver should store the transcodes
      7. PLEX_MEDIA_SERVER_TMPDIR=/tmp
      8. # uncomment to set it to something else
      9. # PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR="${HOME}/Library/Application Support"
      10. # the user that PMS should run as, defaults to 'plex'
      11. # note that if you change this you might need to move
      12. # the Application Support directory to not lose your
      13. # media library
      14. PLEX_MEDIA_SERVER_USER=plex
      15. PLEX_MEDIA_SERVER_HOME=/usr/lib/plexmediaserver
      16. LD_LIBRARY_PATH=/usr/lib/plexmediaserver
      17. LC_ALL=en_US.UTF-8
      18. LANG=en_US.UTF-8
      Display All


      Then the plugin could just write the entire default file like all the plugins do. More reliable than sed'ing for something that may or may not be there.
      omv 4.1.15 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.13
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!
    • sed -i 's#.*{HOME}.*#PLEX_MEDIA_SERVER_SUPPORT_DIR="${HOME}/Library/Application Support"#' /etc/default/plexmediaserver

      Source Code

      1. if ! grep "EnvironmentFile" /etc/systemd/system/plexmediaserver.service ; then
      2. sed -i '/Service/a EnvironmentFile=/etc/default/plexmediaserver' /etc/systemd/system/plexmediaserver.service
      3. systemctl daemon-reload
      4. fi

      The post was edited 2 times, last by tekkb ().

    • @ryecoaaron can you put the latest plex version in the repo. They changed a variable name and the 1714 package is messing things up.

      Source Code

      1. if [ ! -d "${DB_FOLDER}/Library" ]; then
      2. cp -rfp "${PLEX_HOME}" "${DB_FOLDER}"
      3. rm -rf "${PLEX_HOME}"
      4. if ! grep "EnvironmentFile" /etc/systemd/system/plexmediaserver.service ; then
      5. sed -i '/Service/a EnvironmentFile=/etc/default/plexmediaserver' /etc/systemd/system/plexmediaserver.service
      6. systemctl daemon-reload
      7. fi
      8. sed -i "s#${PLEX_HOME}#${DB_FOLDER}#" /etc/default/plexmediaserver
      9. usermod -d "${DB_FOLDER}" plex
      10. fi


      One other line in the postinst to replace /var/lib/plexmediaserver instead of ${HOME}.
      The 2nd sed above needs to be able to search for the plex home string.

      Done except plex user not deleting and library not being removed on uninstall.

      The post was edited 4 times, last by tekkb ().

    • Aaron, I got the override working for the unit file. I don't know if you noticed. I think it would be better to install that file than write it though. Then use the sed command to replace the path to the library. That way the override folder and file would be removed when the plugin is removed without something added to postrm. On initial install the default path can be in the override file /var/lib/plexmediaserver.

      @ryecoaaron

      sed -i "s#${PLEX_HOME}#${DB_FOLDER}#" /etc/systemd/system/plexmediaserver.service.d/db_folder.conf

      The post was edited 2 times, last by tekkb ().

    • The override did work. It just didn't use the defaults file. Didn't think we needed to use it since the current unit file doesn't use it. That file should only need to override the settings you want to change. The defaults file duplicates some settings. You shouldn't need an override file until you change something so no need to install it on package installation.

      I disagree with using sed. OMV and the plugins write (not edit) the entire config file except for the few config files that are modified by multiple services (grub, fstab come to mind). It would be one line in postrm to remove the override dir and file - rm -rf /etc/systemd/system/plexmediaserver.service.d. That file/dir being left would cause any problems like leaving the unit file. It would be like leaving the defaults file.
      omv 4.1.15 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.13
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!
    • I must have had the edited service file leftover on my development VM. I planned on testing on a clean install before releasing and would've have found that. Just didn't have the time yet.
      omv 4.1.15 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.13
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!
    • @ryecoaaron
      Aaron, I was thinking about you writing the file. It is not a config file. I don't think we really need to rewrite all different kinds of files. Especially files where we are going to only make 1 or 2 changes. I really think sed commands can be useful. The sed command searches for an exact match too. In the unit file there will not be another match. My first solution to this issue was very short in coding. I also think Plex will fix errors in the unit file eventually. I don't really care about how this is done as long as it is stable but I think if coding is stable using sed I don't see a problem with it. Staying consistent on config files I understand. But we can try new ideas on other things.

      Something that also might be considered when using sed is where the variables being used are coming from or if they exist already somewhere in the config.xml

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

    • I also have Firestick with Kodi on it. And it's my love. I have recently installed my favourite addon - Yoda firesticktricks.com/yoda-kodi-addon.html, and it's amazing. It gives me total freedom in what I actually need. What I like about this addon mostly is the fact that it has been steadily updated. Yoda gives freedom to watch Movies, TV shows, Documentaries, Networks and more.

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