diff --git a/README.md b/README.md index 84da26e..13063b4 100644 --- a/README.md +++ b/README.md @@ -66,8 +66,20 @@ It creates the `mp_*` tables and `discgod_seller_watch` in `discogs_full` on startup (additive — touches nothing existing). `deploy.sh` is only needed if you ever run the server on a *different* box. -To keep it running across reboots, either add that `nohup` line to your -MONSTERPANEL startup alongside the plice server, or wrap it in a launchd plist. +To keep it running across reboots it's installed as a launchd agent on the Ultra +(`deploy/com.monsterrobot.discgod.plist` → `~/Library/LaunchAgents/`): starts on +login/boot, restarts itself if it crashes, logs to `server/discgod_server.log`. + +```bash +cp deploy/com.monsterrobot.discgod.plist ~/Library/LaunchAgents/ +launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/com.monsterrobot.discgod.plist +# status / stop: +launchctl print gui/$(id -u)/com.monsterrobot.discgod +launchctl bootout gui/$(id -u)/com.monsterrobot.discgod +``` +(LaunchAgent = runs as the johnking user, needed for local Postgres peer auth. If +you want it up even with nobody logged in, convert to a LaunchDaemon in +`/Library/LaunchDaemons` with `UserName johnking` — needs sudo.) ### 2. Extension (the engine + control panel) 1. `chrome://extensions` → enable Developer mode → **Load unpacked** → pick `discgod/extension`. diff --git a/deploy/com.monsterrobot.discgod.plist b/deploy/com.monsterrobot.discgod.plist new file mode 100644 index 0000000..e1c043e --- /dev/null +++ b/deploy/com.monsterrobot.discgod.plist @@ -0,0 +1,57 @@ + + + + + + Label + com.monsterrobot.discgod + + ProgramArguments + + /opt/homebrew/bin/python3 + /Users/johnking/discgod/server/discgod_server.py + + + WorkingDirectory + /Users/johnking/discgod/server + + EnvironmentVariables + + DISCGOD_DB + discogs_full + DISCGOD_PORT + 5057 + PATH + /opt/homebrew/bin:/usr/bin:/bin:/usr/sbin:/sbin + + + RunAtLoad + + + KeepAlive + + + ThrottleInterval + 10 + + StandardOutPath + /Users/johnking/discgod/server/discgod_server.log + StandardErrorPath + /Users/johnking/discgod/server/discgod_server.log + +