PMS as a service

@cjmurph

Any thought to why this is happening? PMS Upgrade (STILL) Failing on Windows The launcher seems to die even before msiexec finishes doing the upgrade.

Are you attempting to do an update from the web interface while running as a service? That’s a bad idea. The service wrapper may attempt to restart Plex in the middle of your installation.

@cjmurph Yes, but I made sure that was not going to be an issue. The same problem occurs with auto-restart enabled at 600 seconds and disabled completely.

Does it work when Plex is running normally (not as a service)?

@cjmurph Yes

Well, I don’t expect doing things like running msi installers in session 0 is a great idea. Could be permissions, could be some other dependant service not running. Honestly, I’d suggest the procedure in the first post of this thread. Stop Plex, run installer, start Plex.

So, this used to work just fine (updating as a service). Running an msi in session 0 hasn’t historically been a problem in my experience, although I haven’t examined the msi logs (if any) to see why the upgrade itself fails. The curious thing here is that the Launcher is failing outright even before the msi has a chance to succeed or fail.

Interesting, I guess you’d need someone from the Plex team to help you, sorry.

Ya, I’ve been trying to get that help for quite a while, but they don’t seem to reply to forum posts and I don’t know of any other communication path (IRC, Discord, Git, etc).

I have been using this PMS as Service solution for past few years. I never auto update. Always stop Plex. Manual update. Start Plex through the Plex service tray application

Auto Updates are not intended for use when running as a service and would be out of scope for any support from plex

I’m not trying to get Plex to support a community add-on, but I would like to be able to troubleshoot this on my own to potentially develop a solution, but there is currently insufficient information to decide the error codes/messages being logged. So, the only thing I’m asking for is that information.

My $0.02…

I’m running PMS through the tray icon (no service wrapper) on Server 2019 in order to ensure proper PMS updates, guarantee hw transcoding, etc.

I was able to use SysInternals Auto Login to ensure PMS starts when the server reboots, and it works perfectly. I had my doubts since setup was a breeze, but it works a treat… (I entered local machine name as the logon domain).

My server is not domain-joined (I figured out in a previous iteration that none of the available tools worked on a domain joined Server 2016, likely the same for 2019)

Yes that would be easy option for simple configurations where you just use the one windows user account.

Just looked into it to see if it would be ok for my setup but not. I run Plex Media Server in a non-admin accounts and I use the PCs normally with my admin account and AutoLogon appears to just auto start one account only.

I hadn’t considered that use case… although I would only expect auto logon to process a single user. How exactly do you run Plex as another user without using a service wrapper? I assume you could use the “Run As” feature when right clicking the shortcut?

EDIT: after further consideration I assume you log on interactively with the Plex account then use “User Switching” to get to the admin account?

In any event, I’ve never experienced issues running Plex under an admin account… are you just being careful or is there some problem you’re addressing by running PMS as a non-admin user?

EDIT: If this is your desired setup, simply auto logon the Plex user… this way, PMS will always be running after a reboot. You’d need to manually log on with the admin user when you want to use the PC interactively., but IMO it’s a small price to pay so that you don’t have to re-invent your setup

I do use the service wrapper for Plex Media Server running in non-admin account.

I took the decision at the beginning that my media will be read-only for Plex Media Server and when recording and photo uploads came along - these libraries were in separate areas with full access to those directories to the plex account.

So I use a windows normal account for the service wrapper and i run the Plex Service tray app in the windows admin account to control the service and start/stop plex and i do the updates manually using the windows admin account. it adds complexity

Exactly. FWIW I’ve toyed with various iterations of a virtualized PMS (ESXI, Hyper-V, Proxmox), and finally settled on a bare metal OS running PMS in a standard configuration for ease of administration. With everything else I need to keep up with, I figure less is more.

The longer story is that the server I’m using for PMS actually has an x16 PCIe slot (for the GPU) but doesn’t have the necessary CPU instructions / BIOS controls to allow passing the GPU through to a VM. My other server only has x8 slots physically, and I didn’t want to modify the slots to accept the GPU. Of course, the GPU (K4000) is critical for transcodes (especially on mobile), and I have enabled the “Sync” feature for all of my users. **This creates a revenue stream for the Plex Team when my users buy the app unlock as well… so for those of you who like to give back, this is one way. You’re welcome Plex Team LOL

Although my media could be modified by PMS, I un-check the box for “allow deletions” and haven’t experienced any unexpected behavior. YMMV

Just to share my setup:

  • I am using the service wrapper with non administrative account
    – external media is set to read only (like movies, series or audio)
    – photos are synced with cloud storage and service user is set to read only as well (https://rclone.org/)
    – PVR is set to full access
  • For updating I am using “PlexServerAutoUpdater” (https://github.com/TechieGuy12/PlexServerAutoUpdater)
    – this runs once a day as scheduled task with administrative rights (somewhere in the morning)
    – within this task I have setup post-processing batch script to remove “autostart of plex on logon”
    – I have set “Server version updates” on Plex to “Ask me” to have full flexibility if I want to update or not
    – If I want to update, I just download the version within Plex and the scheduled task will do the work over night
1 Like

I just wanted to say THANK YOU! I’ve been running this for a while and I couldn’t be happier with the results.

1 Like

Thanks to OP for providing this simple solution to run PMS as a Windows service. You rock!