Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

fix(install): use absolute binary path in pct exec instructions

rcourtman5787cea4eb02
diff --git a/docs/FAQ.md b/docs/FAQ.md
index d98e6fe7d8..af9aa34a31 100644
--- a/docs/FAQ.md
+++ b/docs/FAQ.md
@@ -110,12 +110,12 @@ Delete `/etc/pulse/.env` and restart the service. Pulse will require a bootstrap
sudo pulse bootstrap-token
```
**Proxmox LXC** (installed from the Proxmox shell):
-Pulse runs inside the container, so run the same steps through `pct exec` on the Proxmox host:
+Pulse runs inside the container, so run the same steps through `pct exec` on the Proxmox host. The binary needs its absolute path here, because `pct exec` runs with `PATH=/sbin:/bin:/usr/sbin:/usr/bin` and that does not include `/usr/local/bin`:
```bash
pct exec <ctid> -- rm /etc/pulse/.env
pct exec <ctid> -- systemctl restart pulse
-pct exec <ctid> -- pulse bootstrap-token
+pct exec <ctid> -- /usr/local/bin/pulse bootstrap-token
```
If you only missed the token during a fresh install (no password set yet), skip the first two commands and just read it back with the last one.
diff --git a/docs/INSTALL.md b/docs/INSTALL.md
index e23cfe2aa1..1395bd8728 100644
--- a/docs/INSTALL.md
+++ b/docs/INSTALL.md
@@ -174,7 +174,9 @@ Pulse is secure by default. On first launch, you must retrieve a **Bootstrap Tok
| **Docker** | `docker exec pulse /app/pulse bootstrap-token` |
| **Kubernetes** | `kubectl exec -it <pod> -- /app/pulse bootstrap-token` |
| **Systemd** | `sudo pulse bootstrap-token` |
-| **Proxmox LXC** | `pct exec <ctid> -- pulse bootstrap-token` (run on the Proxmox host; the installer prints this command with your container ID at the end of the install) |
+| **Proxmox LXC** | `pct exec <ctid> -- /usr/local/bin/pulse bootstrap-token` (run on the Proxmox host; the installer prints this command with your container ID at the end of the install) |
+
+The Proxmox path must be absolute. `pct exec` runs with `PATH=/sbin:/bin:/usr/sbin:/usr/bin`, which does not include `/usr/local/bin`, so a bare `pulse` fails with `No such file or directory`.
> **Important**: Paste the token string printed by the command above. Do not paste the raw `.bootstrap_token` file contents directly. In v6 that file may contain an encrypted JSON snapshot rather than the usable setup token.
diff --git a/docs/TROUBLESHOOTING.md b/docs/TROUBLESHOOTING.md
index 89d1cab5df..bfffa570db 100644
--- a/docs/TROUBLESHOOTING.md
+++ b/docs/TROUBLESHOOTING.md
@@ -18,12 +18,12 @@ Delete `/etc/pulse/.env` and restart the service. Pulse will require a bootstrap
sudo pulse bootstrap-token
```
**Proxmox LXC** (installed from the Proxmox shell):
-Pulse runs inside the container, so run the same steps through `pct exec` on the Proxmox host:
+Pulse runs inside the container, so run the same steps through `pct exec` on the Proxmox host. The binary needs its absolute path here, because `pct exec` runs with `PATH=/sbin:/bin:/usr/sbin:/usr/bin` and that does not include `/usr/local/bin`:
```bash
pct exec <ctid> -- rm /etc/pulse/.env
pct exec <ctid> -- systemctl restart pulse
-pct exec <ctid> -- pulse bootstrap-token
+pct exec <ctid> -- /usr/local/bin/pulse bootstrap-token
```
If you only missed the token during a fresh install (no password set yet), skip the first two commands and just read it back with the last one.
diff --git a/docs/release-control/v6/internal/subsystems/deployment-installability.md b/docs/release-control/v6/internal/subsystems/deployment-installability.md
index 46ecacaf5a..75a9308035 100644
--- a/docs/release-control/v6/internal/subsystems/deployment-installability.md
+++ b/docs/release-control/v6/internal/subsystems/deployment-installability.md
@@ -2600,6 +2600,12 @@ first-session setup instructions must also route operators through
`pulse bootstrap-token` with the correct runtime data directory instead of
printing or instructing users to `cat` `.bootstrap_token`, because the file is
an encrypted persistence artifact rather than the raw setup token.
+Any such instruction that an operator runs through `pct exec` must additionally
+name the binary by absolute path. `pct exec` runs with
+`PATH=/sbin:/bin:/usr/sbin:/usr/bin`, which excludes the `/usr/local/bin` link
+the installer creates, so a bare command name fails with exit 127 at the
+operator's very first step. Routing an operator to a correct but unresolvable
+command does not satisfy this contract.
That same bootstrap artifact contract must now be backend-owned as one
canonical install artifact model rather than a handler-local bootstrap struct
plus a second response envelope. Shell downloads, setup-script-url responses,
diff --git a/frontend-modern/public/docs/FAQ.md b/frontend-modern/public/docs/FAQ.md
index d98e6fe7d8..af9aa34a31 100644
--- a/frontend-modern/public/docs/FAQ.md
+++ b/frontend-modern/public/docs/FAQ.md
@@ -110,12 +110,12 @@ Delete `/etc/pulse/.env` and restart the service. Pulse will require a bootstrap
sudo pulse bootstrap-token
```
**Proxmox LXC** (installed from the Proxmox shell):
-Pulse runs inside the container, so run the same steps through `pct exec` on the Proxmox host:
+Pulse runs inside the container, so run the same steps through `pct exec` on the Proxmox host. The binary needs its absolute path here, because `pct exec` runs with `PATH=/sbin:/bin:/usr/sbin:/usr/bin` and that does not include `/usr/local/bin`:
```bash
pct exec <ctid> -- rm /etc/pulse/.env
pct exec <ctid> -- systemctl restart pulse
-pct exec <ctid> -- pulse bootstrap-token
+pct exec <ctid> -- /usr/local/bin/pulse bootstrap-token
```
If you only missed the token during a fresh install (no password set yet), skip the first two commands and just read it back with the last one.
diff --git a/frontend-modern/public/docs/INSTALL.md b/frontend-modern/public/docs/INSTALL.md
index e23cfe2aa1..1395bd8728 100644
--- a/frontend-modern/public/docs/INSTALL.md
+++ b/frontend-modern/public/docs/INSTALL.md
@@ -174,7 +174,9 @@ Pulse is secure by default. On first launch, you must retrieve a **Bootstrap Tok
| **Docker** | `docker exec pulse /app/pulse bootstrap-token` |
| **Kubernetes** | `kubectl exec -it <pod> -- /app/pulse bootstrap-token` |
| **Systemd** | `sudo pulse bootstrap-token` |
-| **Proxmox LXC** | `pct exec <ctid> -- pulse bootstrap-token` (run on the Proxmox host; the installer prints this command with your container ID at the end of the install) |
+| **Proxmox LXC** | `pct exec <ctid> -- /usr/local/bin/pulse bootstrap-token` (run on the Proxmox host; the installer prints this command with your container ID at the end of the install) |
+
+The Proxmox path must be absolute. `pct exec` runs with `PATH=/sbin:/bin:/usr/sbin:/usr/bin`, which does not include `/usr/local/bin`, so a bare `pulse` fails with `No such file or directory`.
> **Important**: Paste the token string printed by the command above. Do not paste the raw `.bootstrap_token` file contents directly. In v6 that file may contain an encrypted JSON snapshot rather than the usable setup token.
diff --git a/frontend-modern/public/docs/TROUBLESHOOTING.md b/frontend-modern/public/docs/TROUBLESHOOTING.md
index 89d1cab5df..bfffa570db 100644
--- a/frontend-modern/public/docs/TROUBLESHOOTING.md
+++ b/frontend-modern/public/docs/TROUBLESHOOTING.md
@@ -18,12 +18,12 @@ Delete `/etc/pulse/.env` and restart the service. Pulse will require a bootstrap
sudo pulse bootstrap-token
```
**Proxmox LXC** (installed from the Proxmox shell):
-Pulse runs inside the container, so run the same steps through `pct exec` on the Proxmox host:
+Pulse runs inside the container, so run the same steps through `pct exec` on the Proxmox host. The binary needs its absolute path here, because `pct exec` runs with `PATH=/sbin:/bin:/usr/sbin:/usr/bin` and that does not include `/usr/local/bin`:
```bash
pct exec <ctid> -- rm /etc/pulse/.env
pct exec <ctid> -- systemctl restart pulse
-pct exec <ctid> -- pulse bootstrap-token
+pct exec <ctid> -- /usr/local/bin/pulse bootstrap-token
```
If you only missed the token during a fresh install (no password set yet), skip the first two commands and just read it back with the last one.
diff --git a/install.sh b/install.sh
index 0f370d989b..930374bc93 100755
--- a/install.sh
+++ b/install.sh
@@ -2062,11 +2062,13 @@ create_lxc_container() {
echo " First-time setup:"
local QUOTED_CONFIG_DIR
printf -v QUOTED_CONFIG_DIR '%q' "$CONFIG_DIR"
- echo " pct exec $CTID -- env PULSE_DATA_DIR=$QUOTED_CONFIG_DIR pulse bootstrap-token"
+ # pct exec runs with PATH=/sbin:/bin:/usr/sbin:/usr/bin, which excludes
+ # /usr/local/bin where the binary is linked, so these must be absolute.
+ echo " pct exec $CTID -- env PULSE_DATA_DIR=$QUOTED_CONFIG_DIR $BINARY_LINK_PATH bootstrap-token"
echo
echo " Common commands:"
echo " pct enter $CTID # Enter container"
- echo " pct exec $CTID -- $(basename "$UPDATE_HELPER_PATH") # Update Pulse"
+ echo " pct exec $CTID -- $UPDATE_HELPER_PATH # Update Pulse"
echo
CONTAINER_CREATED_FOR_CLEANUP=false
diff --git a/scripts/installtests/root_install_sh_test.go b/scripts/installtests/root_install_sh_test.go
index fce769c2d5..819afbbddc 100644
--- a/scripts/installtests/root_install_sh_test.go
+++ b/scripts/installtests/root_install_sh_test.go
@@ -2272,3 +2272,57 @@ func TestRootInstallScriptAutoUpdateConfigDirGuardRunsBeforeStateChanges(t *test
}
}
}
+
+// pct exec runs with PATH=/sbin:/bin:/usr/sbin:/usr/bin. Anything installed to
+// /usr/local/bin, which is where BINARY_LINK_PATH and the non-default update
+// helper live, is therefore unreachable by bare name and fails with exit 127.
+// Every pct exec invocation the installer runs or prints must name a command
+// that is either absolute or genuinely resolvable on that PATH.
+func TestRootInstallPctExecCommandsResolveOnPctExecPath(t *testing.T) {
+ content, err := os.ReadFile(filepath.Join("..", "..", "install.sh"))
+ if err != nil {
+ t.Fatalf("read root install.sh: %v", err)
+ }
+
+ // Commands that really do live on the pct exec PATH.
+ resolvable := map[string]bool{
+ "bash": true,
+ "sh": true,
+ "rm": true,
+ "hostname": true,
+ "systemctl": true,
+ "env": true,
+ }
+
+ pctExec := regexp.MustCompile(`pct exec [^\n]*? -- (.+)`)
+ for i, line := range strings.Split(string(content), "\n") {
+ match := pctExec.FindStringSubmatch(line)
+ if match == nil {
+ continue
+ }
+ fields := strings.Fields(match[1])
+ // Skip any leading `env KEY=VALUE` prefix to reach the real command.
+ for len(fields) > 1 && (fields[0] == "env" || strings.Contains(fields[0], "=")) {
+ fields = fields[1:]
+ }
+ if len(fields) == 0 {
+ continue
+ }
+ command := strings.Trim(fields[0], `"'`)
+ if strings.HasPrefix(command, "$") || strings.HasPrefix(command, "${") {
+ // A variable reference is fine as long as it is not wrapped in
+ // basename, which is what strips the directory off an absolute path.
+ if strings.Contains(match[1], "basename") {
+ t.Fatalf("install.sh:%d passes a basename to pct exec, which drops the directory and breaks PATH resolution: %s", i+1, strings.TrimSpace(line))
+ }
+ continue
+ }
+ if strings.HasPrefix(command, "/") {
+ continue
+ }
+ if resolvable[command] {
+ continue
+ }
+ t.Fatalf("install.sh:%d runs %q through pct exec by bare name, which is not on PATH=/sbin:/bin:/usr/sbin:/usr/bin: %s", i+1, command, strings.TrimSpace(line))
+ }
+}