session-tools/contrib/com.natalie.bigdisk-mount-guard.plist
Natalie 44086ca45e feat(session-tools): disk-guard/bigdisk-mount-guard tools + wa console/lookup
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-29 14:35:20 -04:00

55 lines
2.1 KiB
Text

<?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">
<!--
bigdisk-mount-guard LaunchDaemon.
Keeps the ~/_/bigdisk NFS mount (Apple Photos originals + other storage on black)
alive on a roaming Mac (sleep, network roam, WG flap, "no WiFi" location switches).
The guard now also:
- Auto-brings the wg1 WireGuard mesh when the storage IP is unreachable.
- On successful remount, does Photos library autorecover (DB lock cleanup,
restart of photoanalysisd/photolibraryd, restore of the canonical symlink
if it had been temporarily stubbed).
Runs as root every 60s + on network interface/resolv changes (via WatchPaths).
Install (as root):
sudo cp ~/Code/@scripts/session-tools/contrib/com.natalie.bigdisk-mount-guard.plist /Library/LaunchDaemons/
sudo chown root:wheel /Library/LaunchDaemons/com.natalie.bigdisk-mount-guard.plist
sudo chmod 644 /Library/LaunchDaemons/com.natalie.bigdisk-mount-guard.plist
sudo launchctl bootstrap system /Library/LaunchDaemons/com.natalie.bigdisk-mount-guard.plist
(The script itself lives at ~/Code/@scripts/session-tools/bin/bigdisk-mount-guard
and can also be run by hand as root for testing: .../bigdisk-mount-guard --status
or --force.)
Uninstall:
sudo launchctl bootout system/com.natalie.bigdisk-mount-guard
sudo rm /Library/LaunchDaemons/com.natalie.bigdisk-mount-guard.plist
-->
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.natalie.bigdisk-mount-guard</string>
<key>ProgramArguments</key>
<array>
<string>/Users/natalie/Code/@scripts/session-tools/bin/bigdisk-mount-guard</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StartInterval</key>
<integer>60</integer>
<key>WatchPaths</key>
<array>
<string>/etc/resolv.conf</string>
<string>/Library/Preferences/SystemConfiguration/NetworkInterfaces.plist</string>
</array>
<key>ProcessType</key>
<string>Background</string>
<key>LowPriorityIO</key>
<true/>
<key>StandardErrorPath</key>
<string>/var/log/bigdisk-mount-guard.err</string>
</dict>
</plist>