Skip to content

Linux root systemd daemon starts child CLIs without HOME #7591

Open

Description

@ainurminibaev

Summary

The standard Linux machine installer creates a root systemd service without HOME or User=. systemd starts that service without a home environment, which BB passes to child CLIs. Git fails with fatal: $HOME not set, and CLI configuration lookup can fall back to the working directory rather than the existing user profile.

Versions and environment

  • bb-app 0.49.0, standard Linux machine installer, root-owned system service.
  • Ubuntu 24.04.4 LTS, systemd 255, Node.js v24.22.3.
  • Observed on two Linux machine daemons. No provider is required to reproduce.
  • Also verified against the installer at current source base da3e60b81d560e114a2bec724bb59c997aaaae7f: new unit assertions fail because the generated service omits HOME.

Steps to reproduce

  1. Enroll a Linux/systemd machine with the standard installer as root.
  2. After the installer starts its system service, run a machine terminal:
    bb terminal run --machine <machine-id> --cwd /tmp -- node -e 'console.log("HOME=" + String(process.env.HOME))'
    bb terminal run --machine <machine-id> --cwd /tmp -- git config --global --get user.name
  3. Alternatively reproduce the relevant service environment without enrolling or changing a BB machine:
    sudo systemd-run --quiet --unit=bb-home-repro --wait --pipe --collect \
      "$(command -v node)" -e '
        console.log("HOME=" + String(process.env.HOME));
        const r = require("node:child_process").spawnSync(
          "/usr/bin/git", ["config", "--global", "--get", "user.name"],
          { encoding: "utf8" }
        );
        console.log("git exit=" + r.status);
        process.stdout.write(r.stderr);
      '

Expected vs actual

Expected: child CLIs receive the configured service user's home directory and can locate their existing configuration.

Actual output from the temporary service:

HOME=undefined
git exit=128
fatal: $HOME not set

Supplying HOME in a systemd drop-in and restarting the affected daemons corrected their child environments.

Evidence

What was ruled out

  • An account login problem: the existing user credentials were present; using the correct home restored lookup.
  • Provider-specific behavior: a plain Git subprocess reproduces it.
  • fix(install): systemd service uses ephemeral fnm Node.js path and fails after reboot #6773: Node is found and the daemon is running; this is a missing home environment rather than an ephemeral Node path.
  • The installer's existing unset-HOME handling only fixes its own process. The system service it writes still omits HOME.

Suggested priority and effort

Affects standard root/systemd Linux enrollments and child CLI configuration lookup. A service drop-in is a workaround; the installer and daemon startup need a small fix plus regression tests.

AGENT GENERATED

Activity

  1. added theissue type on Nov 15, 2026
  2. added
    host
    confirmed-repro
    on Nov 15, 2026
  3. bb-slop-cop commented on Nov 15, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    • Classification: Bug · Priority: Medium · Effort: Low · Area: host.
    • Report: https://get-bb.github.io/reports/issues/7591.html
    • Verdict: REPRODUCED · Root-cause confidence: high · Reproduction label: confirmed-repro.
    • Cause: the installer recovers HOME in its own process but omits it from the generated systemd service environment. Both service-generation cases fail the added regression assertion in two clean trusted-main checkouts; isolated Git lookup fails without HOME and succeeds with it. Live systemd enrollment was not tested.
    • Regression: install-machine-script.test.ts → installs a persistent root system unit, with the added HOME assertion shown in the report: two expected failures in each checkout.
    • No fix PR: changing machine-service installer packaging is excluded by this rule’s simple-fix gate.
  4. added a commit that references this issue on Dec 2, 2026
    6001266
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-reprohost

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions