fix(migrate-daniel-to-kanidm): robust deps + smarter session guard #501
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix-migrate-daniel-unit"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
The migration oneshot introduced in #498 silently bailed on every boot on foxtrot (and anywhere else that got rebooted cleanly — it only worked on thinker because we ran it by hand). Two bugs, one trivial one structural:
${pkgs.x}/bin/yabsolute paths and half-used bare commands (getent,grep,dirname).set -e+ baregetent= silentcommand not found→ the "daniel not resolvable via NSS" branch fires and the unit returns success-with-nothing-done. Same forgrepon the session guard.loginctl list-sessions | awk '{print $3}' | grep -qx danielfires on any session nameddaniel, which includes both the pre-migrationuser@1000.servicelingering from the old generation AND the new kanidm session once a user logs in. So after a normal reboot, the unit effectively never migrates — the guard always matches something.Changes
letblock withpath = [ coreutils findutils gawk glibc.bin gnugrep rsync shadow systemd ]so every binary resolves naturally (andgetent/grep/dirnameactually exist).getent passwd danielfor the post-migration uid, then skip only if there's an active session at a different uid (i.e. the uid=1000 lingering). A kanidm session at the new uid doesn't block migration.Test plan
/home/daniel/.home(foxtrot)..home, chowns/home/daniel, writes/var/lib/lyte/migrate-daniel-to-kanidm.done.253263e774ca5af6b042ca5af6b0425fb7f812ddPull request closed