Skip to content

fix(cli): carry rivetos.service drop-ins over to rivethub.service - #1202

Merged
philbert440 merged 1 commit into
philbert440:mainfrom
xreed88:fix/migrate-carry-unit-dropins
Oct 19, 2026
Merged

philbert440 merged 1 commit into
philbert440:mainfrom
xreed88:fix/migrate-carry-unit-dropins

Conversation

@xreed88

@xreed88 xreed88 commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator

migrate-to-rivethub renders a fresh rivethub.service and never looks at rivetos.service.d/, so any drop-in the old unit depended on is lost in the switch.

Hit this migrating a user-scope desktop node (omarchy). rivetos.service had two drop-ins:

The rendered unit's PATH starts with ~/.local/bin, so without the drop-in the loop would return.

Change

  • The probe reads systemctl show rivetos.service -p DropInPaths (with the user manager for user units). It keeps only *.conf files in a rivetos.service.d directory: shared service.d drop-ins already apply to every unit, and /run ones are transient.
  • The install step copies them into rivethub.service.d/ before the first daemon-reload, without overwriting a file of the same name. For a system unit the copy runs as root through sudo -n sh -c. The dry run names them in the step title.
  • Rollback and the automatic recovery remove each copy that still matches its source (cmp -s), then the directory if it's empty.
  • The guide, help text and CHANGELOG are updated.

Tests

  • 5 new cases in migrate-to-rivethub.test.ts: discovery filter, copy before daemon-reload, root for system units, no change without drop-ins, rollback removal. All 76 tests in the command pass; tsc, eslint and prettier are clean.
  • Checked the real systemctl --user show … -p DropInPaths --value output format on the node: space-separated absolute paths.

migrate-to-rivethub renders a fresh rivethub.service and never looked at
rivetos.service.d/. A node whose service depended on a drop-in lost it in
the switch: on a user-scope desktop node that was a Wants/After on the
SSH tunnel to the datahub, and a PATH override that keeps ~/.local/bin
(Omarchy's mise wrappers, which exec-loop when they precede the mise
install dirs) after the tool dirs. The new unit's PATH starts with
~/.local/bin, so the loop would come back.

The probe now reads the unit's drop-ins from systemctl show -p
DropInPaths, keeping only the persistent files in a rivetos.service.d
directory (shared service.d drop-ins already apply to every unit; /run
ones are transient). The install step copies them into
rivethub.service.d before the first daemon-reload, without overwriting
a file of the same name, as root for a system unit. The dry run names
them in the step title. Rollback and recovery remove each copy that
still matches its source, then the directory if empty.
@philbert440
philbert440 merged commit d226d76 into philbert440:main Oct 19, 2026
6 checks passed
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.

2 participants