Link <name>-update into /usr/bin so pct exec finds it without the full path

pct exec runs without a login shell and its PATH may lack /usr/local/bin.
setup.sh adds the link on Linux; update.sh adds it to older installs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
neil 2026-11-04 21:05:20 -08:00
parent be727949c1
commit c9738358de
8 changed files with 19 additions and 11 deletions

View file

@ -108,7 +108,7 @@ Run the same commands as above on the node, as root. The installer:
- named `netmon-hub` or `netmon-probe-<node>`
2. **Starts it** and waits for network.
3. **Copies the installer in** and runs it in native mode. It installs Python, sets up ping and creates the systemd service.
4. **Prints the container's IP** and the `pct exec` commands to update it, read its logs and edit its settings. `pct exec` runs commands with a minimal PATH that doesn't include `/usr/local/bin`, so the update command needs its full path: `pct exec <ctid> -- /usr/local/bin/network-monitor-update`. Inside the container (`pct enter <ctid>`), plain `network-monitor-update` works.
4. **Prints the container's IP** and the `pct exec` commands to update it, read its logs and edit its settings. The update command is in `/usr/local/bin` and linked into `/usr/bin`, so `pct exec <ctid> -- network-monitor-update` finds it even though `pct exec` doesn't run a login shell. Inside the container (`pct enter <ctid>`), the same command works.
To change the defaults, set these before `bash`:
@ -172,7 +172,7 @@ read -rsp 'Gitea token: ' GIT_TOKEN && export GIT_TOKEN && curl -fsSL -H "Author
git push # from your machine
docker exec network-monitor update # hub, Docker
sudo network-monitor-update # hub, native Linux (no sudo as root; macOS: network-monitor-update)
pct exec <ctid> -- /usr/local/bin/network-monitor-update # hub in a Proxmox LXC, from the node
pct exec <ctid> -- network-monitor-update # hub in a Proxmox LXC, from the node
docker exec network-probe update # probe, Docker
sudo network-probe-update # probe, native Linux (macOS: network-probe-update)
```
@ -197,7 +197,7 @@ The installer prints the uninstall command at the end. In short:
| Install | Command |
|---|---|
| Docker | `cd /opt/<name> && docker compose -f <compose.yml or compose.probe.yml> down -v`, then `rm -rf /opt/<name>` |
| Native Linux | `systemctl disable --now <name> && rm -rf /opt/<name> /etc/systemd/system/<name>.service /usr/local/bin/<name>-update` |
| Native Linux | `systemctl disable --now <name> && rm -rf /opt/<name> /etc/systemd/system/<name>.service /usr/local/bin/<name>-update /usr/bin/<name>-update` |
| macOS | `sudo launchctl bootout system/dev.neilbantoc.<name>; sudo rm -rf /opt/<name> /Library/LaunchDaemons/dev.neilbantoc.<name>.plist /usr/local/bin/<name>-update` |
`<name>` is `network-monitor` (hub) or `network-probe`.