If you google, there are a lot of people who have a lot of problems with Plex Media Server on power cuts. My one was that if the plexmediaserver.pid isn’t cleaned up by clean shutdown then it remains forever, until manual intervention.
Basically:
Aug 20 05:58:17 linux-server systemd[1]: Started Plex Media Server.
Aug 20 05:58:17 linux-server Plex Media Server[2034]: Plex Media Server is already running. Will not start...
Aug 20 05:58:17 linux-server systemd[1]: plexmediaserver.service: Main process exited, code=exited, status=1/FAILURE
Aug 20 05:58:17 linux-server systemd[1]: plexmediaserver.service: Failed with result 'exit-code'.
Behold the evil file:
root@linux-server:/var/lib/plexmediaserver/Library/Application Support/Plex Media Server# ls
Cache Codecs 'Crash Reports' Logs Media Metadata plexmediaserver.pid Plug-ins 'Plug-in Support' Preferences.xml
Whats inside the file:
root@linux-server:/var/lib/plexmediaserver/Library/Application Support/Plex Media Server# cat plexmediaserver.pid
993
Maybe there is a process number 993 somewhere? Nope:
993root@linux-server:/var/lib/plexmediaserver/Library/Application Support/Plex Media Server# ps -aux |grep 993
root 2186 0.0 0.0 9076 2400 pts/3 S+ 06:13 0:00 grep --color=auto 993
So, I have fixed this in my instance by modifying the systemd startup script to delete any stale pid files before running Plex Media Server. But if you guys want a better general user experience then I would suggest you change Plex Media Server to not just check for the presence of the pid file but also check the contents actually points to a running instance of Plex Media Server.
Not everything is shutdown nicely in the real world, and assuming that it is causes great strife for end users.