macOS: run the launchd daemon as root so it can reach the LAN
On macOS 15, Local Network privacy blocks LAN connections from a launchd daemon running as a user (EHOSTUNREACH; curl works), and a daemon can't show the permission prompt. Tested on 15.3.1 with the probe's own Python: a root daemon connects to the hub, the same daemon with UserName gets "No route to host". The plist no longer sets UserName. The checkout, venv and <name>-update stay owned by the installing user. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
30ce39d5f0
commit
380243545c
4 changed files with 17 additions and 4 deletions
|
|
@ -29,7 +29,7 @@ Remote: `https://git.neilbantoc.dev/services/network-monitor.git` (Gitea). The r
|
|||
| lxc (Proxmox node) | A container made by the installer; inside it, the same as native Linux. | `pct exec <ctid> -- /usr/local/bin/<name>-update` (full path: `pct exec` runs with a minimal PATH without `/usr/local/bin`) | `pct exec <ctid> -- journalctl -u <name> -f` |
|
||||
| docker | `compose.yml` (hub, bridge, port 8000) / `compose.probe.yml` (probe, `network_mode: host`). The image is runtime only; the source is cloned into a volume. | `docker exec network-monitor update` / `docker exec network-probe update` | `docker logs -f <name>` |
|
||||
| native, Linux | `/opt/<name>` is the git checkout plus `.venv/`, `data/`, `.env`, `.native`. A systemd unit `<name>.service` runs `native/run.sh` as user `netmon`. | `sudo <name>-update` | `journalctl -u <name> -f` |
|
||||
| native, macOS | Same layout. The LaunchDaemon `/Library/LaunchDaemons/dev.neilbantoc.<name>.plist` runs as the installing user. | `<name>-update` (no sudo; it calls sudo for `launchctl kickstart`) | `/opt/<name>/data/service.log` |
|
||||
| native, macOS | Same layout, owned by the installing user. The LaunchDaemon `/Library/LaunchDaemons/dev.neilbantoc.<name>.plist` runs the app as **root**: macOS 15 Local Network privacy blocks LAN connections from a daemon running as a user (`[Errno 65] No route to host` while curl works), and root daemons are exempt (tested on 15.3.1). | `<name>-update` (no sudo; it calls sudo for `launchctl kickstart`) | `/opt/<name>/data/service.log` |
|
||||
|
||||
`<name>` is `network-monitor` (hub) or `network-probe`. Mode defaults:
|
||||
- **native** on macOS and inside LXC (detected with `systemd-detect-virt -c`)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue