Skip to content

fix(systemd): reconcile managed-env unit migrations#2494

Open
BingqingLyu wants to merge 1 commit into
mainfrom
pr-66444-kitsune-pr-66295-carry-main
Open

fix(systemd): reconcile managed-env unit migrations#2494
BingqingLyu wants to merge 1 commit into
mainfrom
pr-66444-kitsune-pr-66295-carry-main

Conversation

@BingqingLyu

@BingqingLyu BingqingLyu commented Apr 28, 2026

Copy link
Copy Markdown
Owner

Summary

  • carry #66295 onto current main
  • fix the two real migration regressions from review: rebuild malformed units when ExecStart= is missing, and reconcile stale WorkingDirectory= in-place instead of leaving CHDIR failures behind
  • remove the redundant managed-env split and clean up the temp-home test leakage

Fixes openclaw#66248.
Related openclaw#66219.
Supersedes openclaw#66295.

Why this carry exists

#66295 had the right core direction: move OpenClaw-managed systemd env into a drop-in so upgrades stop clobbering user EnvironmentFile= and Environment= directives.

The branch still needed maintainer follow-up in three spots:

  1. malformed existing units with no ExecStart= were no longer repaired
  2. stale WorkingDirectory= values could survive migration and fail startup at CHDIR
  3. the new integration tests were leaving temp dirs behind

This carry fixes those and keeps the user-preserving drop-in design intact.

Verification

  • pnpm test:serial src/daemon/systemd-unit.test.ts src/daemon/systemd.test.ts
  • pnpm build

Changelog

Added under ## Unreleased with:

  • Thanks @solomonneas.
  • Carry follow-up: @vincentkoc.

@BingqingLyu BingqingLyu added conflicting-group-1 Conflicting PR group 1 — review as a batch conflicting-pr Shares at least one cross-PR dependency with other PRs labels May 26, 2026
@BingqingLyu

Copy link
Copy Markdown
Owner Author

⚠️ Cross-PR Conflict Detected

This PR shares modified code with #2513.

Shared functions:

Function File Also modified by
expectExecStartWithoutEnvironment src/daemon/systemd.test.ts #2513
stageSystemdService src/daemon/systemd.ts #2513

Recommendation: Coordinate with #2513 before merging.


Auto-detected by codegraph — a code graph analysis tool built on neug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conflicting-group-1 Conflicting PR group 1 — review as a batch conflicting-pr Shares at least one cross-PR dependency with other PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

openclaw update silently drops user-added EnvironmentFile/Environment directives when regenerating systemd unit

2 participants