bug: service_proc stop errors on socket cleanup — rm is nu builtin (service_proc.nu:330) #109

Closed
opened 2026-04-21 15:25:29 +00:00 by sameh-farouk · 0 comments
Member

Summary

service_proc stop errors out on its last step with:

Error: nu::shell::error
  × Complete only works with external commands
   ╭─[service_proc.nu:330:34]
   │ do { rm -f $sock } | complete | ignore

The graceful RPC shutdown and pkill steps may have already completed, so the process is actually stopped — but the socket file is left behind and the user sees an error instead of a clean exit.

Location

tools/modules/services/service_proc.nu:330:

do { rm -f $sock } | complete | ignore

rm is a nushell built-in, so | complete (which only works on external commands) fails.

Proposed fix

Use the external rm:

do { ^rm -f $sock } | complete | ignore

Or simpler, since rm -f is a no-op on missing files and the sudo branch above already uses ^sudo rm -f:

if $sock_still_there {
    if (svc_need_sudo $root) {
        do { ^sudo rm -f $sock } | complete | ignore
    } else {
        do { ^rm -f $sock } | complete | ignore
    }
}

Impact

Low severity but 100% reproducible — every non-sudo service_proc stop that leaves a stale socket errors out, confusing users.

### Summary `service_proc stop` errors out on its last step with: ``` Error: nu::shell::error × Complete only works with external commands ╭─[service_proc.nu:330:34] │ do { rm -f $sock } | complete | ignore ``` The graceful RPC shutdown and pkill steps may have already completed, so the process is actually stopped — but the socket file is left behind and the user sees an error instead of a clean exit. ### Location `tools/modules/services/service_proc.nu:330`: ```nu do { rm -f $sock } | complete | ignore ``` `rm` is a nushell built-in, so `| complete` (which only works on external commands) fails. ### Proposed fix Use the external `rm`: ```nu do { ^rm -f $sock } | complete | ignore ``` Or simpler, since `rm -f` is a no-op on missing files and the sudo branch above already uses `^sudo rm -f`: ```nu if $sock_still_there { if (svc_need_sudo $root) { do { ^sudo rm -f $sock } | complete | ignore } else { do { ^rm -f $sock } | complete | ignore } } ``` ### Impact Low severity but 100% reproducible — every non-sudo `service_proc stop` that leaves a stale socket errors out, confusing users.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_skills#109
No description provided.