I’ve been asking around for help with installing PlexPy. I tried to use docker, but I could not get the settings to save properly on a reboot of NAS. I tried to install via PlexPys Linux instructions but on a reboot I can no longer find the /opt/PlexPy directory.
I did all this from root.
First thing I did was install git, so I could git clone the repo. I did that by installing the Git Server from Synology. Then I made a folder called repos in root’s home directory:
chmod +x /usr/syno/etc.defaults/rc.d/S99plexpy.sh /usr/local/start/plexpy.start.sh
Now it will start at boot, and you can also start/stop/restart it with the following commands:
Thanks for this. I found a straight copy paste of S99plexpy.sh resulted in the stop command not working. It was failing to extract the correct pid to kill. I fixed it by replacing the following line:
A follow up question - have you managed to get HTTPS working? It appears that PlexPy needs the pyOpenSSL module installing separately, any idea how to do that?
@benadderson said:
Thanks for this. I found a straight copy paste of S99plexpy.sh resulted in the stop command not working. It was failing to extract the correct pid to kill. I fixed it by replacing the following line:
@benadderson said:
A follow up question - have you managed to get HTTPS working? It appears that PlexPy needs the pyOpenSSL module installing separately, any idea how to do that?
I would ask and follow this post - it’s a Q&A for PlexPy.
@benadderson said:
Thanks for this. I found a straight copy paste of S99plexpy.sh resulted in the stop command not working. It was failing to extract the correct pid to kill. I fixed it by replacing the following line:
@benadderson said:
A follow up question - have you managed to get HTTPS working? It appears that PlexPy needs the pyOpenSSL module installing separately, any idea how to do that?
I would ask and follow this post - it’s a Q&A for PlexPy.
you can use pip to install python modules that are needed using something like ‘pip install pyOpenSSL’
Hi, if you use docker (https://github.com/linuxserver/docker-plexpy) you need to map the /config directory to a directory on your filesystem, otherwise the settings will be lost on each pull of a new docker image.
@CornholioLU said:
Hi, if you use docker (GitHub - linuxserver/docker-tautulli) you need to map the /config directory to a directory on your filesystem, otherwise the settings will be lost on each pull of a new docker image.
Can you explain how to do that please? Unfortunately I have no idea what I’m doing.
Before I saw this thread I came up with a simpler solution that works fine for me. But might not be as technically correct as some of the ones posted here.
I just extracted the PlexPy file from the downloaded archive on git into a folder onto my NAS, and then I made a simple script that I also placed somewhere on the NAS and named it “PlexPy_Start.sh”:
#!/bin/sh
# Check if already running, if not then run
if ps | grep -v grep | grep -q PlexPy.py; then
: # do nothing if already running
else
python "/volume1/Plex/PlexPy/PlexPy.py" &
fi
In the Task Scheduler in the DSM interface I made a task which runs this script every 5 minutes or so, making sure that the PlexPy restarts if it for some reason would crash it also starts it on reboot (worst case with a delay of 5 minutes after boot).
Regarding updating the PlexPy you do not need git on the NAS since the PlexPy interface will tell you when there is a new version and it also gives you a button to press to automatically update to the latest version.
I’ve been trying to get this to work all day and having no success at all. Running Xpenology / Synology DSM 5.2 on HP MicroServer Gen8.
Running /usr/syno/etc.defaults/rc.d/S99plexpy.sh start
or
/usr/syno/etc.defaults/rc.d/S99plexpy.sh
Results in:
: not foundtc.defaults/rc.d/S99plexpy.sh: line 7:
: not foundtc.defaults/rc.d/S99plexpy.sh: line 10: echo
/usr/syno/etc.defaults/rc.d/S99plexpy.sh: return: line 11: Illegal number: 127
This is very odd… line 10 is just “echo” and line 11 is just “return $RETVAL”
Make a folder somewhere that PlexPy can keep its saved config. I made a plexpy folder in the docker shared folder (/volume3/docker/plexpy). I also make a textfile /volume3/docker/timezone containing just your TZ, in my case “Pacific/Auckland” (no quotes) so that the docker container would pick up the correct time (see volume mapping below).
SSH into your Synology and run the following, docker run \ --name="plexpy" \ -p 8183:8181 \ --volume=/etc/localtime:/etc/localtime:ro \ --volume=/volume3/docker/timezone:/etc/timezone:ro \ --volume=/volume3/docker/plexpy/config:/config \ --volume="/volume3/Plex/Library/Application Support/Plex Media Server/Logs":/logs:ro \ -e PUID=1026 \ -e PGID=100 \ --restart=always \ --detach \ linuxserver/plexpy
Notes
Be aware of users and permissions.
Change and names, paths and ports to suit your environment.
-p, exposed port:internal port, i.e. connect to http://nas-ip:8183
--volume=/volume3/docker/plexpy:/config, is where you want plexpy to save it’s config so it persists between reboots
--volume="/volume3/Plex/Library/Application Support/Plex Media Server/Logs":/logs:ro, is the location of your PMS log folder and mapped location in the docker container (/logs)
-e PUID=1026, a user’s uid to run the docker container as with read/write to plexpy config folder and read access to the PMS logs, you may have set some permission either in the DSM Control Panel or via SSH
-e PGID=100, a gid (groupid) for the UID above
--restart=always, so that if the container exits, Docker will restart it.
--detach run in background
linuxserver/plexpy, the docker image
Give it a minute or two to get fired up and it’ll show in your Docker Container tab where you can then stop/start/edit to your heart’s content. Open PlexPy in your browser on http://nas-ip:8183 and configure as required. Be sure to set your Settings for Plex Media Server → Plex IP or Hostname to the IP address/hostname of the machine running PMS - 127.0.0.1 won’t do as the docker container isn’t running Plex. Also be sure Logs Folder is set to /logs. Set your Plex.tv Account by fetching a token (you’ll see on the Plex.tv Account setting page).
@artiss The method you describe above is not working on the latest DSM 6 beta 2. It worked flawlessly on DSM 5 but something changed. I know its a beta but if anyone has a heads up on what needs to change to get it to work on DSM 6, we can get ahead of the curve here. Thanks!
@dankster - I have pretty much the above running on DSM6.0RC without problem. A few mods to the S99 script and created some symlinks to git, but working fine…
Spoke to soon. Updated DSM6.0RC to full version and wiped out my PlexPy. Guess I should have not used the defaults directories. Any how, reinstalled and all working again. Some details as follows:
did the ‘git pull’ into this directory: /volume1/@appstore/plexpy/PlexPy.py
created start script here: /usr/local/start/plexpy.start.sh
and added startup script here: /usr/syno/etc.defaults/rc.d/S99plexpy.sh
@rjblake thanks for the follow up my man. can you tell me which user you logged in via ssh with? i think my issue is the symlinks or something…
UPDATE:
i was able to get it to run by sshing in as Admin then “Sudo su -” which switched me to root. i then followed the directions above and it seems to be working!