(crashes) plex service or plex "launcher" to auto restart after PMS crashes

Server Version#:1.20.3.3241
(win 2012r2 server os , dedicated, plex only, supermiciro server)
Player Version#: NA

over the past 3 or so months, PMS (app) has been crashing pretty frequently (seems to have started a few versions ago).

in 5+ yrs of running PMS, across 2x servers, this has never really been an issue.

are there any plans to make PMS on windows run as a windows service? (or allow this as an option or advanced config feature?) - the goal being a auto restart the app if it crashes.
or maybe have a “helper/launcher” app that then launches PMS and just monitors if its https server is still responding (and if not, try restarting the app).

Im referring to PMS app crashes (not OS or other crashes, ofcouse).
I know there are ways to script this, or even force PMS to run as a win service, but id like to stick to native, “supported” releases / setups.
thanks!

You can already do that with NSSM.
But running PMS as a service will lose you the ability to use hardware decoding during transcoding.

Thanks for the reply/link, i was aware of solutions like this, but was hoping that plex would consider implementing something like this natively (or if not maybe, why?)

(or if it was on the roadmap?)
thanks

I don’t have access to this kind of roadmap information. I am also not aware of such plans.

tks-

Plex really needs to address this issue, PMS should be a reliable system that requires minimum intervention (once setup , and other than adding / sorting media). 98% of my 5+ yrs of running PMS, it has been stable and solid, however there are times/update trees when it is not (and at those times, it seems to be a while before the issues are addressed).

Also bc on the apple tv Plex app, plex pop’s up that confusing server update message, i freqently have guests accidnetlly performing updates on my PMS, so its a bit difficult to remain on a specific (stable) PMS release. thus this script at the bottom:

so in case it helps others, this is the .bat file i ended up writing/using. (is scheduled by task mgr to run every 15m).

it checks for the plex string on the content returned by the local plex https server (actually in its ssl cert).
i thought this to be the best/most reliable way of checking if PMS is up / down and hopefully surviving PMS updates/changes. (there are many other ways to do this however).
For many years now , I have had offsite PRTG monitoring PMS’ https server (via a content string returned/searched for), and this has been a super reliable way to get notified when PMS has crashed (or is otherwise down)

also i am not a coder, so there are other (prob. better) solutions out there, but i like this and am comfortable with how it works (and have tested it). i also have splunk universal FW 'er picking up the logs this bat file generates, which is why they are in the script.

(note , alot of the comments/REM statements are of methods that did NOT work, for one reason or another. i would delete them to make this cleaner, but they may help someone searching for this topic
thanks

@echo off
REM oct 14 2020-   script to check if PMS is web https replying and if not restart it
REM  this script also logs to a txt file in the same folder as the bat file

REM tasklist | find "Plex Media Server"
REM set LOGFILE=batch.log
REM call :LOG >> %LOGFILE%
REM exit /B
REM :LOG

REM Start /b ""  "C:\Program Files (x86)\Plex\Plex Media Server\Plex Media Server.exe"
REM /b is not working right bc plex starts incorrectly
REM cd "C:\Program Files (x86)\Plex\Plex Media Server\"
REM call "cmd /c start Plex Media Server.exe"
REM call "C:\Program Files (x86)\Plex\Plex Media Server\Plex Media Server.exe"


REM echo the time and date to my log file
time /t >> C:\plexRestartScript\logall2.txt
date /t >> C:\plexRestartScript\logall2.txt

REM the find command IS case sensitive the /i makes it inSensitive

wget -T 4 -t 2 --spider https://172.17.2.2:32400/ 2>&1 | find /i "plex" >nul
if errorlevel 1 (
    echo Plex Web is down >> C:\plexRestartScript\logall2.txt
	echo !!! NOW RESTARTING PLEX APP !!! >> C:\plexRestartScript\logall2.txt

	start "" "C:\Program Files (x86)\Plex\Plex Media Server\Plex Media Server.exe"
	echo Plex Server app has been restarted >> C:\plexRestartScript\logall2.txt
) else (
    echo Plex Web is up >> C:\plexRestartScript\logall2.txt
)

echo ----------------------- >> C:\plexRestartScript\logall2.txt

exit /b 1
REM you need to use the start command as is so that PMS runs then 
REM exits this bat file, such that task sch
REM can keep running this script wo it remaining stuck open

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