service_proc.nu: rm -f $sock | complete breaks stop when running as root #79
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_skills#79
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
While running the comprehensive test for #77,
service_proc stop --rootinvoked as root (against root's own hero_proc) failed with:Root cause
rmis a Nushell built-in, sodo { rm -f $sock } | completeis rejected. The sister branch (line 268) uses^sudo rmwhich is external, so it works — only the plainrmbranch has the bug.When it triggers
Path taken when
svc_need_sudo $rootreturns false (i.e. the invoking user is already root and targeting root's hero_proc) and the socket file still exists at cleanup time.Fix
Change
rm→^rmso Nushell treats it as an external command:One-line change. Verified on the Hetzner box during the #77 test (patched in place, test passed, patch reverted).
Out of scope for this issue
Belongs in its own PR per the #75 / per-service flow. Feel free to pick this up as a quick drive-by fix for whoever takes it next.
PR #114 fixes it in commit
ce7d16b