fleet/orbit/pkg
Allen Houchins fa38063590
Fix Fleet Desktop not launching on OpenSUSE 16 (#44482)
This pull request addresses a startup issue with Fleet Desktop on
openSUSE Leap 16 and similar Linux distributions. The main change is to
adjust how Fleet Desktop and key-escrow dialogs are launched to avoid
environment variable loss caused by login shell profile scripts. The fix
is scoped specifically to openSUSE Leap 16+ to avoid impacting other
distributions.

**Distribution-specific sudo invocation changes:**

* The `-i` (login shell) flag is now omitted from the `sudo` command
when launching Fleet Desktop and key-escrow dialogs on openSUSE Leap 16
and newer, preventing environment variables from being lost due to
profile script interference.
[[1]](diffhunk://#diff-633ab361af6795ef458233819e2806dfba4ca56f684866d956321825b8fd2e91R1)
[[2]](diffhunk://#diff-3e8315d9f12512bce490457c5d20bd7c5aebaa2a8e18b1abf50e504815dd7a9dR178-R193)
* For all other supported distributions, the previous behavior (using
`-i`) is preserved to maintain compatibility and avoid unnecessary
re-testing.

**Detection logic:**

* Introduced a new helper function `isOpenSUSELeap16Plus` in
`execuser_linux.go` to detect if the host is running openSUSE Leap 16 or
newer by parsing `/etc/os-release`. This ensures the workaround is only
applied where necessary.

---


**Related issue:** N/A — surfaced via field investigation on openSUSE
Leap 16 (arm64).

This PR addresses two distinct issues that together prevent Fleet
Desktop from working on openSUSE Leap 16, both validated end-to-end on a
real Leap 16 (arm64) host.

## 1. Launch reliability — drop `sudo -i`

`orbit/pkg/execuser/execuser_linux.go`

On Linux, Orbit launches Fleet Desktop with:

```
sudo -n -i -u <user> -H env WAYLAND_DISPLAY=… … FLEET_DESKTOP_DEVICE_IDENTIFIER_PATH=/opt/orbit/identifier … /…/fleet-desktop
```

The `-i` flag makes sudo "simulate initial login" — it runs the target
user's shell as a login shell and wraps the rest of the command in `bash
--login -c '<escaped>'`. That sources `/etc/profile` and every script in
`/etc/profile.d/*` before our `env KEY=val … fleet-desktop` line runs,
and shell metacharacters (`=`, `:`, `/`, `.`) get backslash-escaped
through the shell layer.

On **openSUSE Leap 16 (arm64)**, that indirection causes the inline
env-var assignments to not reach `fleet-desktop`, which exits
immediately with:

```
FTL missing URL environment FLEET_DESKTOP_DEVICE_IDENTIFIER_PATH
```

Orbit then respawns it every ~15 s in a tight kill-and-respawn loop, so
the tray icon never appears.

**Fix:** drop `-i` from the sudo invocation. We don't need a login
shell:
- `-H` already sets `HOME` to the target user.
- sudo's default `env_reset` sets `USER` / `LOGNAME` / `SHELL` / `MAIL`
and `PATH` to `secure_path`.
- All session vars (`WAYLAND_DISPLAY`, `DISPLAY`,
`DBUS_SESSION_BUS_ADDRESS`, `LD_LIBRARY_PATH`) and every
`FLEET_DESKTOP_*` var are already passed explicitly via `env KEY=val …`.

After the change, sudo `execve()`s `env` directly with no shell layer in
between, so `/etc/profile.d` sourcing and shell-escaping are out of the
picture.

The `runuser -l` /proc/keys-leak regression from PR #32309 does not
apply — that was specific to `runuser -l` creating session keyrings;
sudo without `-i` doesn't.

# Checklist for submitter

- [x] Changes file added:
`orbit/changes/fleet-desktop-linux-no-login-shell`
- [x] Input data is properly validated; untrusted data interpolated into
shell scripts/commands is validated against shell metacharacters.
- [x] Timeouts are implemented and retries are limited to avoid infinite
loops (script's wait loop now bounded at 90s).
- [x] If paths of existing endpoints are modified without backwards
compatibility, checked the frontend/CLI for any necessary changes — N/A.

## Testing

Manual QA needed before merge:

- [x] **openSUSE Leap 16 (arm64)** — Fleet Desktop process starts, stays
running, env vars present, no FTL respawn loop. Done via `sudo` shim.
- [x] **openSUSE Leap 16 (arm64) — extension fallback** — manual tarball
install + schema compilation produces a working tray icon (matching what
the script automates).
- [ ] **Ubuntu 22.04 / 24.04** — regression check: Fleet Desktop tray
icon still appears, key-escrow zenity dialog still renders, AppIndicator
script still installs via the official path.
- [ ] **Fedora (recent)** — regression check: same as above.
- [ ] **Debian** — regression check: same as above.
- [ ] **openSUSE Tumbleweed** — confirm `InstallRemoteExtension` path
still works (no fallback path triggered).

## fleetd/orbit/Fleet Desktop

- [x] Verified compatibility with the latest released version of Fleet —
pure launch-flag change plus a script update; no protocol or schema
impact.
- [x] If the change applies to only one platform, confirmed that
`runtime.GOOS` is used as needed to isolate changes — Go change is in
`execuser_linux.go`, only built on Linux. The script is Linux-only by
construction.
- [ ] Verified that fleetd runs on macOS, Linux and Windows — Linux
re-verification pending QA above; macOS/Windows code paths unchanged.
- [ ] Verified auto-update works from the released version of component
to the new version.

## Notes for reviewers

- The tray-icon visibility issue is an OS-side prerequisite (GNOME 3.26+
has no native tray), so the AppIndicator extension is required
regardless. Even after installing it, Wayland requires a logout/login to
pick up new extensions — this is documented behavior and not specific to
the fallback path.
2026-05-01 23:26:56 -05:00
..
augeas Update golangci-lint to v2.4.0 (#33251) 2025-09-22 13:17:11 -05:00
bitlocker Add Windows Go tests to CI (#43365) 2026-04-13 10:49:15 -05:00
build Add user agent to Orbit HTTP client (#5429) 2022-05-02 11:03:49 -07:00
constant Changes to not rely on Fleet Desktop for Linux setup experience (#33018) 2025-09-16 13:26:00 -03:00
cryptoinfo Enable staticcheck Go linter. (#23487) 2024-11-05 11:16:24 -06:00
dataflatten Additional CA validation (#27169) 2025-03-19 08:27:55 -05:00
dialog Removed indicator for background LUKS validation (#28218) 2025-04-16 12:25:41 -04:00
execuser Fix Fleet Desktop not launching on OpenSUSE 16 (#44482) 2026-05-01 23:26:56 -05:00
go-paniclog Fix Windows lint issues and enable linting on Windows (#28704) 2025-05-02 16:11:26 -04:00
insecure Make creation of http.Client uniform across the codebase (#3097) 2021-11-24 15:56:54 -05:00
installer Bound orbit retries on missing installer details to 5 mins (#44284) 2026-04-28 12:58:10 -04:00
kdialog Fix orbit active GUI session detection to start Fleet Desktop and key escrowing on Linux (#39777) 2026-02-16 11:41:16 -03:00
keystore Update golangci-lint to v2.4.0 (#33251) 2025-09-22 13:17:11 -05:00
logging Reduce orbit logging when the server is down (#16968) 2024-02-21 15:36:15 -03:00
luks Fix orbit active GUI session detection to start Fleet Desktop and key escrowing on Linux (#39777) 2026-02-16 11:41:16 -03:00
lvm Linux agent LVM volume detection on older Ubuntu versions (#24193) 2024-11-27 10:39:25 -07:00
migration fix: add missing comments 2024-08-15 19:00:47 -04:00
osquery Enable gzip compression in osquery when run by Orbit (#38673) 2026-01-27 12:14:55 -08:00
osservice 8009 fleet desktop icon duplication (#8017) 2022-10-13 10:58:37 -03:00
packaging Use Docker as default WiX runtime on macOS arm64 (#43715) 2026-04-21 10:53:46 -05:00
platform Fix fleetd crash in Apple M5 hardware by upgrading gopsutil (#41940) 2026-03-18 11:21:02 -03:00
process Fleetctl to package .app bundles for osquery (and changes for orbit to support them) (#4393) 2022-03-15 16:04:12 -03:00
profiles check for DEP capable migration before showing automatic preview (#41274) 2026-03-10 14:51:29 -05:00
scripts Add Python script support for macOS and Linux (#38562) 2026-03-24 10:01:54 -04:00
setup_experience Improve initial loading state of macOS setup experience when displaying web view UI (#41561) 2026-03-16 10:30:47 -05:00
swiftdialog Use webview in MacOS setup experience (#33884) 2025-10-08 17:51:26 +01:00
table Bump macadmins/osquery-extension to v1.4.1 and add network_quality ta… (#44214) 2026-04-27 14:52:27 -03:00
token Make StartRotation concurrency safe (#34186) 2025-10-15 14:28:52 -05:00
update Bitlocker: do not decrypt already encrypted drive. (#43130) 2026-04-09 18:33:03 -04:00
user Icon mis sized on KDE envs (#40259) 2026-02-24 11:59:35 -04:00
useraction Make orbit and Fleet Desktop not depend on server/service/ packages (#42231) 2026-03-26 10:59:42 -03:00
windows Add Kolide osquery tables 2023-11-01 20:11:35 -06:00
zenity Fix orbit active GUI session detection to start Fleet Desktop and key escrowing on Linux (#39777) 2026-02-16 11:41:16 -03:00