Repository navigation
Description
This was generated by AI during triage.
On an SELinux-enforcing host (Rocky/RHEL 9, 5.14.0-687.10.1.el9_8.0.1.x86_64), the Console that thirdshift console install sets up never starts. Caddy serves a 502 for the Console address, yet the install script ends with "Valid configuration". Three separate defects combine to cause this.
Reproduce
thirdshift update(0.13.0 to 0.13.5,x86_64-unknown-linux-musl-static, installed at~/.local/bin/thirdshift)thirdshift setup, answer yes to "Run the Console?"thirdshift console install --output install-console.sh && sudo sh install-console.sh- Browse to the Console address: HTTP 502.
thirdshift-console.servicerestarts every 5 s, and nothing listens on127.0.0.1:8711.
1. thirdshift update leaves the binary labelled user_tmp_t
After the update the binary carried the temp-file label, not the label for its path:
-rwxr-xr-x. jstephens jstephens unconfined_u:object_r:user_tmp_t:s0 ~/.local/bin/thirdshift
$ matchpathcon ~/.local/bin/thirdshift
~/.local/bin/thirdshift unconfined_u:object_r:home_bin_t:s0
The updater probably downloads into a temp directory and then rename()s the file into place, and a rename keeps the source label. systemd (init_t) cannot execute user_tmp_t:
Failed to locate executable /home/jstephens/.local/bin/thirdshift: Permission denied
avc: denied { execute } for comm="(irdshift)" name="thirdshift" scontext=system_u:system_r:init_t:s0 tcontext=unconfined_u:object_r:user_tmp_t:s0 tclass=file permissive=0
Fix: download into the destination directory before renaming, or run restorecon on the final path when SELinux is enabled.
2. The generated unit cannot run from $HOME under SELinux enforcing
The unit has User=jstephens and ExecStart=/home/jstephens/.local/bin/thirdshift console. Even after restorecon (home_bin_t) the process runs as init_t, because home_bin_t defines no domain transition, and init_t cannot read user_home_t:
can't read /home/jstephens/.thirdshift/config.toml: Permission denied (os error 13)
avc: denied { read } for comm="thirdshift" name="config.toml" scontext=system_u:system_r:init_t:s0 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=file permissive=0
The harness logins (~/.claude and others) and the repo checkouts would hit the same denial next.
Adding SELinuxContext=system_u:system_r:unconfined_service_t:s0 on its own does not fix it. unconfined_service_t accepts only bin_t, usr_t and shell_exec_t as entrypoints:
avc: denied { entrypoint } for path="/home/jstephens/.local/bin/thirdshift" scontext=system_u:system_r:unconfined_service_t:s0 tcontext=unconfined_u:object_r:home_bin_t:s0 tclass=file permissive=0
Two approaches should work:
- Run the binary from a
bin_tpath such as/usr/local/bin.init_tthen transitions tounconfined_service_ton its own, as[email protected]from/usr/bindoes. The catch is thatthirdshift updatewould need to update that copy too. - Keep the binary in
$HOMEand enter through the shell:This also survives defect 1, because an unconfined process can executeSELinuxContext=system_u:system_r:unconfined_service_t:s0 ExecStart=/bin/sh -c 'exec /home/<user>/.local/bin/thirdshift console'user_tmp_t.
At a minimum, console install should check getenforce and warn when it reports Enforcing.
3. The install script reports success without checking the service
install-console.sh ends with caddy validate and systemctl restart caddy, so its last line of output is "Valid configuration" even when the Console service never starts. The script should wait for systemctl is-active thirdshift-console.service, and ideally for a listener on 127.0.0.1:8711, and fail loudly with the last journal lines when neither appears. The 502 was the first sign that anything had gone wrong.
Activity
JacobStephens2 commentedon Oct 25, 2026
Triage: ready for a human
Defect 3 (install reports success without checking the service) is split out as #1327. Defects 1 (
updateleaves the binary mislabelled) and 2 (the unit runs from$HOMEwithout an SELinux context) are still present. Fixing them needs a choice of approach (copy to/usr/local/bin, orsh -cwithunconfined_service_t) and verification on a Rocky/RHEL enforcing host.Next step: pick the approach and say which enforcing host can verify it.
JacobStephens2 commentedon Nov 12, 2026
Investigation of duplicate report #2131 at Base commit cf12290 found that the underlying launch/update paths remain: src/console/install.rs:130 directly executes the installed binary, and src/update.rs:79-108 uses AxoUpdater::run_sync with no subsequent label restoration.
#2131 reports that ExecStart=/bin/sh -c "exec /home//.local/bin/thirdshift console" works on its enforcing Rocky Linux 9 host and survives updates. This is reporter evidence, not an independently verified policy recommendation.
The warning and startup diagnostics requested here are already implemented in src/console/install.rs:107-152 and documented at docs/guide.md:1036. tests/console_install.rs:201 exercises the enforcing-only warning with a fake getenforce; its service checks are also simulated. tests/update.rs:229 uses a fake release installer. These do not establish SELinux execution or label correctness.
Next steps remain choosing the supported SELinux launch/update approach and validating an actual release update on an enforcing Rocky host, including service restart and access to the account's config and working files. Coordinate updater work with #1592; restoring the executable label alone does not address the home-directory access denial already reported here.