feat(linux): run systemd service as unprivileged numa user #118

Merged
razvandimescu merged 11 commits from feat/linux-drop-privileges into main 2026-04-19 03:04:54 +08:00
Showing only changes of commit 763131478f - Show all commits

View File

@@ -1713,7 +1713,12 @@ fn install_service_binary_linux() -> Result<std::path::PathBuf, String> {
// rename swaps the path while the running process keeps the old inode. // rename swaps the path while the running process keeps the old inode.
let tmp = dst.with_extension("new"); let tmp = dst.with_extension("new");
std::fs::copy(&src, &tmp).map_err(|e| { std::fs::copy(&src, &tmp).map_err(|e| {
format!("failed to copy {} -> {}: {}", src.display(), tmp.display(), e) format!(
"failed to copy {} -> {}: {}",
src.display(),
tmp.display(),
e
)
})?; })?;
std::fs::rename(&tmp, &dst).map_err(|e| { std::fs::rename(&tmp, &dst).map_err(|e| {
let _ = std::fs::remove_file(&tmp); let _ = std::fs::remove_file(&tmp);