app.olivetin.olivetin.plist 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
  3. <!--
  4. launchd service definition for OliveTin on macOS.
  5. This is the macOS equivalent of the Linux systemd unit (var/systemd/OliveTin.service).
  6. As a per-user LaunchAgent (recommended, no root needed):
  7. cp app.olivetin.olivetin.plist ~/Library/LaunchAgents/
  8. launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/app.olivetin.olivetin.plist # start now + at login
  9. launchctl bootout gui/$(id -u) ~/Library/LaunchAgents/app.olivetin.olivetin.plist # stop + disable
  10. As a system-wide LaunchDaemon (starts at boot, before login; needs root):
  11. sudo cp app.olivetin.olivetin.plist /Library/LaunchDaemons/
  12. sudo chown root:wheel /Library/LaunchDaemons/app.olivetin.olivetin.plist
  13. sudo launchctl load /Library/LaunchDaemons/app.olivetin.olivetin.plist
  14. Edit the two paths below to match where you installed the binary and config.
  15. -->
  16. <plist version="1.0">
  17. <dict>
  18. <key>Label</key>
  19. <string>app.olivetin.olivetin</string>
  20. <!-- Path to the OliveTin binary, then flags. -configdir is the directory
  21. that contains your config.yaml. -->
  22. <key>ProgramArguments</key>
  23. <array>
  24. <string>/usr/local/bin/OliveTin</string>
  25. <string>-configdir</string>
  26. <string>/Users/YOUR_USER/etc/OliveTin</string>
  27. </array>
  28. <!-- systemd's Restart=always -->
  29. <key>KeepAlive</key>
  30. <true/>
  31. <!-- Start at load (login for a LaunchAgent, boot for a LaunchDaemon) -->
  32. <key>RunAtLoad</key>
  33. <true/>
  34. <!-- For LaunchAgent (per-user): use /Users/YOUR_USER/Library/Logs/olivetin.log
  35. For LaunchDaemon (system-wide): use /usr/local/var/log/olivetin.log -->
  36. <key>StandardOutPath</key>
  37. <string>/Users/YOUR_USER/Library/Logs/olivetin.log</string>
  38. <key>StandardErrorPath</key>
  39. <string>/Users/YOUR_USER/Library/Logs/olivetin.log</string>
  40. </dict>
  41. </plist>