{"record":{"id":"68dc5bca53b0ec94","repo":"libnyanpasu/clash-nyanpasu","slug":"failed-to-restart-service-exit-code-signal","errorCode":null,"errorMessage":"failed to restart service, exit code: {}, signal: {:?}","messagePattern":"failed to restart service, exit code: (.+?), signal: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/tauri/src/core/service/control.rs","lineNumber":285,"sourceCode":"    })\n    .await??;\n    if !child.success() {\n        anyhow::bail!(\n            \"failed to restart service, exit code: {}, signal: {:?}\",\n            child.code().unwrap_or(-1),\n            {\n                #[cfg(unix)]\n                {\n                    child.signal().unwrap_or(0)\n                }\n                #[cfg(not(unix))]\n                {\n                    0\n                }\n            }\n        );\n    }\n    Ok(())\n}","sourceCodeStart":267,"sourceCodeEnd":303,"githubUrl":"https://github.com/libnyanpasu/clash-nyanpasu/blob/f7dbce2997c633e484f54788035e770b3ee99773/backend/tauri/src/core/service/control.rs#L267-L303","documentation":"restart_service ran the service restarter with elevated privileges (RunasCommand on Windows, sudo on macOS) and the child process exited non-zero, so the nyanpasu service was not restarted. This is the ExitStatus guard on the privileged restart command: failure points to a denied elevation prompt, a service that is not installed, or the service failing to come back up after stop.","triggerScenarios":"Thrown at backend/tauri/src/core/service/control.rs:285 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry and accept the UAC/sudo elevation prompt.","Verify the service is installed and running via status(); reinstall (install_service) if it is missing.","Run the service binary manually with the `restart` argument as administrator to capture detailed output.","If restart keeps failing, stop then start the service as separate steps to isolate which phase fails."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f7dbce2997c633e484f54788035e770b3ee99773","analyzedAt":"2026-09-08T01:24:59.197Z","contentChangedAt":"2026-09-08T01:24:59.197Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}