-
-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Launch Server as a Service #44
Comments
This still applies: https://superuser.com/questions/930389/how-to-start-a-service-using-mac-osxs-launchctl Creating a script is rather easy. Just need to make the proper files to toss into launchd's folders. If you want Jellyfin to do more than just launch, you'd then need to compile a daemon alongside it. Though a user can simply add it to Open at Login to accomplish what the scripts will do. Aside from needing to run the actual app bundle. Another option entirely is to create a modern binary that plugs into macOS's new "Allow in background". |
Here is what I did. Seems working OK.
<?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>Label</key>
<string>XYZJellyfin</string>
<key>LimitLoadToSessionType</key>
<array>
<string>Aqua</string>
<string>Background</string>
<string>LoginWindow</string>
<string>StandardIO</string>
<string>System</string>
</array>
<key>ProgramArguments</key>
<array>
<string>/path/to/portable/binary/goes/here/jellyfin</string>
<string>--datadir</string>
<string>/opt/xyz/data</string>
<string>--configdir</string>
<string>/opt/xyz/config</string>
<string>--cachedir</string>
<string>/opt/xyz/cache</string>
<string>--logdir</string>
<string>/opt/xyz/logs</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>EnvironmentVariables</key>
<dict>
<key>PATH</key>
<string>/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin</string>
</dict>
<key>WorkingDirectory</key>
<string>/opt/xyz/Jellyfin</string>
<key>StandardErrorPath</key>
<string>/opt/xyz/Jellyfin/stderr.log</string>
<key>StandardOutPath</key>
<string>/opt/xyz/Jellyfin/stdout.log</string>
</dict>
</plist> You may wish to replace
After this your Jellyfin instance should be reachable (as usual) via http://127.0.0.1:8096. To stop service: To restart: To disable macOS service: To print status: To print even more detailed status: Using above method you can run multiple instances of Jellyfin (on different HTTP ports). The only issue I see so far: Only one server can have "Client Auto Discovery" feature enabled. Otherwize they will conflict each other. "Client Auto Discovery" feature can be disabled in a |
Per user request, we should look at how to launch the server as a service on macOS, before login.
In restart/power outage situations, this would allow the server to start back up without user intervention.
It's been a long time since I've tried to look at anything related to
launchd
, so this is an opportunity to start.The text was updated successfully, but these errors were encountered: