Skip to content

fix(tuxcloud): run install step via script, not inline POSIX shell - #2

Merged
nosduco merged 1 commit into
mainfrom
fix/tuxcloud-install-shell
Aug 15, 2026
Merged

fix(tuxcloud): run install step via script, not inline POSIX shell#2
nosduco merged 1 commit into
mainfrom
fix/tuxcloud-install-shell

Conversation

@nosduco

@nosduco nosduco commented Aug 15, 2026

Copy link
Copy Markdown
Owner

Fixes the Command [...] failed on the tuxcloud step in #1.

Cause

Dotbot runs shell commands through whatever $SHELL says:

# dotbot/src/dotbot/util/common.py
executable = os.environ.get("SHELL")
return subprocess.call(command, shell=True, executable=executable, ...)

.tmux.conf:2 sets default-shell /bin/fish, so a tmux pane exports SHELL=/bin/fish. The inline if ... then ... fi was handed to fish, which does not accept POSIX if-syntax:

fish: Missing end to balance this if statement

Reproduced with the exact string parsed from install.conf.yaml, through dotbot's own shell_command:

SHELL=/bin/bash   exit = 0
SHELL=/bin/fish   exit = 127

This passed pre-merge verification because those checks ran from a bash context. My mistake: I validated the step by hand instead of through the shell ./install actually uses.

Fix

Logic moves to scripts/install-tuxcloud-mount.sh with a #!/bin/bash shebang, which pins the interpreter no matter what the caller's shell is. install.conf.yaml just invokes it, with a comment recording why.

The Nautilus bookmark step is folded into the same script. It happened to be fish-compatible, but only by luck.

Also drops the || true that was swallowing the enable --now result. The server is LAN-only, so that genuinely fails off-LAN; it now prints a warning and leaves the unit enabled for next boot instead of reporting success.

Verification

Run dotbot-style under each shell, twice, for idempotency:

SHELL=/bin/bash   run1 exit = 0    run2 exit = 0
SHELL=/bin/fish   run1 exit = 0    run2 exit = 0
SHELL=/bin/sh     run1 exit = 0    run2 exit = 0

service: active    bookmark entries: 1    mount entries: 43

Related, not fixed here

The other ./install failure (voyager-cmdline-tweaks.sh) is a separate, pre-existing bug: dotbot's shell plugin ignores if:. Only the link plugin implements it (link.py:51,56); shell.py reads just command/description/stdin/stdout/stderr/quiet. So every host-gated shell command runs on every host. All eight voyager system files are currently installed on nighthawk, and voyager-power-state.service is enabled on the desktop. Worth its own PR - needs a decision on approach.

The "Enabling rclone tuxcloud mount" step failed on ./install with a bare
"Command [...] failed", despite the mount itself being healthy.

Cause: dotbot's shell plugin runs commands with
`executable = os.environ.get("SHELL")` (dotbot/src/dotbot/util/common.py).
.tmux.conf sets tmux default-shell to /bin/fish, so a pane exports
SHELL=/bin/fish, and the inline `if ... then ... fi` was handed to fish,
which does not accept POSIX if-syntax. Exit 127.

It passed every check before merge because those ran from a bash context
where SHELL=/bin/bash. Reproduced directly:

    SHELL=/bin/bash   exit = 0
    SHELL=/bin/fish   exit = 127

Moving the logic into a script with a `#!/bin/bash` shebang pins the
interpreter regardless of the caller's shell. The Nautilus bookmark step is
folded in as well - it happened to be fish-compatible, but only by luck.

Also stops swallowing the enable failure with `|| true`. The server is
LAN-only, so `enable --now` genuinely fails off-LAN; that now prints a
warning and leaves the unit enabled for the next boot, rather than
reporting success.

Verified dotbot-style under SHELL=bash, fish, and sh, twice each: exit 0,
no duplicate bookmark, mount still serving 43 entries.
@nosduco
nosduco merged commit 7a4f79e into main Aug 15, 2026
@nosduco
nosduco deleted the fix/tuxcloud-install-shell branch August 15, 2026 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant