[object Object]

← back to Commercialrealestate

ops: launchd LaunchAgent for cre-viewer reboot persistence (KeepAlive, no pm2)

b40a08b4f242ba03473433e6bd1e5fe2f6df33d4 · 2026-07-01 09:57:56 -0700 · Steve Abrams

Files touched

Diff

commit b40a08b4f242ba03473433e6bd1e5fe2f6df33d4
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Wed Jul 1 09:57:56 2026 -0700

    ops: launchd LaunchAgent for cre-viewer reboot persistence (KeepAlive, no pm2)
---
 deploy/README.md                  | 19 +++++++++++++++++++
 deploy/com.steve.cre-viewer.plist | 36 ++++++++++++++++++++++++++++++++++++
 2 files changed, 55 insertions(+)

diff --git a/deploy/README.md b/deploy/README.md
new file mode 100644
index 0000000..f47feee
--- /dev/null
+++ b/deploy/README.md
@@ -0,0 +1,19 @@
+# cre-viewer reboot persistence
+
+`com.steve.cre-viewer.plist` is a launchd LaunchAgent that keeps the CRE viewer
+(`scripts/serve.js`, port 9911, bound to 127.0.0.1) alive across reboots and crashes.
+
+- RunAtLoad → starts on login/reboot
+- KeepAlive → auto-respawns if the process dies
+- No pm2 involvement (pm2 daemon is unreliable on this box)
+
+## Install / update
+```sh
+cp deploy/com.steve.cre-viewer.plist ~/Library/LaunchAgents/
+launchctl bootout   gui/$(id -u)/com.steve.cre-viewer 2>/dev/null
+launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/com.steve.cre-viewer.plist
+launchctl kickstart gui/$(id -u)/com.steve.cre-viewer
+```
+
+Tailnet access (persists separately via `tailscale serve`):
+https://stevestudio2s-mac-studio.tail79cb8e.ts.net:9911
diff --git a/deploy/com.steve.cre-viewer.plist b/deploy/com.steve.cre-viewer.plist
new file mode 100644
index 0000000..a7f1d39
--- /dev/null
+++ b/deploy/com.steve.cre-viewer.plist
@@ -0,0 +1,36 @@
+<?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>com.steve.cre-viewer</string>
+
+    <key>ProgramArguments</key>
+    <array>
+        <string>/usr/local/bin/node</string>
+        <string>scripts/serve.js</string>
+    </array>
+
+    <key>WorkingDirectory</key>
+    <string>/Users/stevestudio2/Projects/commercialrealestate</string>
+
+    <key>EnvironmentVariables</key>
+    <dict>
+        <key>PORT</key>
+        <string>9911</string>
+        <key>PATH</key>
+        <string>/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>
+    </dict>
+
+    <key>RunAtLoad</key>
+    <true/>
+
+    <key>KeepAlive</key>
+    <true/>
+
+    <key>StandardOutPath</key>
+    <string>/Users/stevestudio2/Projects/commercialrealestate/tmp/cre-viewer.launchd.log</string>
+    <key>StandardErrorPath</key>
+    <string>/Users/stevestudio2/Projects/commercialrealestate/tmp/cre-viewer.launchd.err.log</string>
+</dict>
+</plist>

← 07e0977 feat: deeds FREE-PASS part (a) — extend broker-history to al  ·  back to Commercialrealestate  ·  feat: clean extension-less URLs (/mls, /brokers, /map, etc.) 7f658fc →