PlexPy: Cannot start as a service (python not found)

Status
Not open for further replies.

JoeB

Contributor
Joined
Oct 16, 2014
Messages
121
I have plexpy installed (pkg plexpy) in a warden jail. All was working fine until i recently restarted the box.

Now I cannot start plexpy service, but I can successfully run it directly:

Code:
root@plexpy:/ # service plexpy start
Starting plexpy.
Error: Python not found!

root@plexpy:/ # which python
python: Command not found.

root@plexpy:/ # which python2
/usr/local/bin/python2

root@plexpy:/ # which python2.7
/usr/local/bin/python2.7


I believe this error is being generated by the code at the top of this script:

https://github.com/JonnyWong16/plexpy/blob/master/PlexPy.py
Code:
#!/bin/sh
''''which python	>/dev/null 2>&1 && exec python	"$0" "$@" # '''
''''which python2 >/dev/null 2>&1 && exec python2 "$0" "$@" # '''
''''which python2.7 >/dev/null 2>&1 && exec python2.7 "$0" "$@" # '''
''''exec echo "Error: Python not found!" # '''


Starting directly:

Code:
root@plexpy:/ # ./usr/local/plexpy/PlexPy.py
2017-12-31 19:34:16 - INFO :: MainThread : Checking to see if the database has all tables....
2017-12-31 19:34:16 - INFO :: MainThread : Retrieving latest version information from GitHub
2017-12-31 19:34:16 - DEBUG :: MainThread : Requesting URL via GET method: https://api.github.com/repos/JonnyWong16/plexpy/commits/master
2017-12-31 19:34:17 - DEBUG :: MainThread : Latest version is cfd30996264b7e9fe4ef87f02d1cc52d1ae8bfca
2017-12-31 19:34:17 - INFO :: MainThread : PlexPy is up to date
2017-12-31 19:34:17 - INFO :: MainThread : PlexPy PlexTV :: Requesting URLs for server...
2017-12-31 19:34:17 - INFO :: MainThread : PlexPy Config :: Writing configuration to file
2017-12-31 19:34:18 - INFO :: MainThread : PlexPy Config :: Writing configuration to file
2017-12-31 19:34:18 - INFO :: MainThread : PlexPy PlexTV :: Server URL retrieved.
2017-12-31 19:34:18 - INFO :: MainThread : PlexPy Pmsconnect :: Requesting name from server...
2017-12-31 19:34:18 - INFO :: MainThread : PlexPy PlexTV :: Requesting users list refresh...
2017-12-31 19:34:18 - INFO :: MainThread : PlexPy PlexTV :: Users list refreshed.
2017-12-31 19:34:18 - INFO :: MainThread : PlexPy Pmsconnect :: Requesting libraries list refresh...
2017-12-31 19:34:21 - INFO :: MainThread : PlexPy Config :: Writing configuration to file
2017-12-31 19:34:21 - INFO :: MainThread : PlexPy Pmsconnect :: Libraries list refreshed.
2017-12-31 19:34:21 - INFO :: MainThread : Scheduled background task: Check GitHub for updates
2017-12-31 19:34:21 - INFO :: MainThread : Scheduled background task: Refresh Plex server URLs
2017-12-31 19:34:21 - INFO :: MainThread : Scheduled background task: Refresh Plex server name
2017-12-31 19:34:21 - INFO :: MainThread : Scheduled background task: Check for Plex remote access
2017-12-31 19:34:21 - INFO :: MainThread : Scheduled background task: Check for Plex updates
2017-12-31 19:34:21 - INFO :: MainThread : Scheduled background task: Refresh users list
2017-12-31 19:34:21 - INFO :: MainThread : Scheduled background task: Refresh libraries list
2017-12-31 19:34:21 - INFO :: MainThread : Scheduled background task: Backup PlexPy database
2017-12-31 19:34:21 - INFO :: MainThread : Scheduled background task: Backup PlexPy config
2017-12-31 19:34:21 - INFO :: Thread-1 : PlexPy WebSocket :: Opening secure websocket, connection attempt 1.
2017-12-31 19:34:21 - INFO :: MainThread : PlexPy WebStart :: Web server authentication is enabled, username is '********'
2017-12-31 19:34:21 - INFO :: MainThread : PlexPy WebStart :: Starting PlexPy web server on http://0.0.0.0:8181/
2017-12-31 19:34:21 - INFO :: Thread-1 : PlexPy WebSocket :: Ready
 
Last edited:

nojohnny101

Wizard
Joined
Dec 3, 2015
Messages
1,478
Have you tried destroying the jail and reinstalling?
 

JoeB

Contributor
Joined
Oct 16, 2014
Messages
121
Yes, and that worked, but I would have liked to have found out why it stopped in the first place.

I backup up the plexpy.db and config.ini file (/usr/local/plexpy) (using SFTP)
destroyed jail
reinstalled
started service
stopped service
copied back the two original files above, and restarted the jail.

It's running again and all my logs and settings are maintained.
 
Status
Not open for further replies.
Top