I'm trying to get Plex Media Server (PMS) to launch at boot time even if no users are logged in. I'm using Lingon to generate the plist file which ends up here: /Library/launchdaemons
Trouble is, it doesn't work.
I've tried all of this on both a 2017 iMac running the Ventura Public Beta and on a M1 iMac running Monterey, 12.6. It fails equally well on both machines.
If I use Lingon's "Test" facility I get the following error message:
1: Operation not permitted
PMS: failure detected. Read/write access is required for path: Plex Media Server
I'm not sure what path "Plex Media Server" refers to.
If I reboot the machine, PMS does not launch. If I try to load the plist I get:
MrMuscle:LaunchDaemons mnewman$ sudo launchctl load -w com.mgnewman.plex.plist
/Library/LaunchDaemons/com.mgnewman.plex.plist: service already loaded
Load failed: 37: Operation already in progress
But PMS is not running
Note that it does work if I put the plist here:
~/Library/launchagents, but only if I'm logged in and that's not what I want.
What do I need to do to make this work?
Here's the entire launchd plist file:
MrMuscle:LaunchDaemons mnewman$ sudo cat com.mgnewman.plex.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Disabled</key>
<false/>
<key>EnvironmentVariables</key>
<dict>
<key>PATH</key>
<string>/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/Apple/usr/bin:/Applications/Wireshark.app/Contents/MacOS:/usr/local/sbin:/opt/local/bin</string>
</dict>
<key>KeepAlive</key>
<dict>
<key>Crashed</key>
<true/>
<key>SuccessfulExit</key>
<true/>
</dict>
<key>Label</key>
<string>com.mgnewman.plex</string>
<key>ProgramArguments</key>
<array>
<string>Applications/Plex Media Server.app/Contents/MacOS/Plex Media Server</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>