fix: systemd service and terminal logging cleanup

Key fixes:
- Systemd service now runs as root (was openagent user)
- Removed ProtectHome=true which blocked /root access
- Working directory set to /root
- Simplified terminal command logging
This commit is contained in:
Thomas Marchand
2025-12-16 15:52:50 +00:00
parent b15d244481
commit b0bebcfe4e

View File

@@ -67,7 +67,6 @@ impl Tool for RunCommand {
let timeout_secs = args["timeout_secs"].as_u64().unwrap_or(60);
tracing::info!("Executing command in {:?}: {}", cwd, command);
tracing::debug!("CWD exists: {}, is_dir: {}", cwd.exists(), cwd.is_dir());
// Determine shell based on OS
let (shell, shell_arg) = if cfg!(target_os = "windows") {
@@ -102,14 +101,8 @@ impl Tool for RunCommand {
let stderr = String::from_utf8_lossy(&output.stderr);
let exit_code = output.status.code().unwrap_or(-1);
tracing::info!("Command completed: exit={}, stdout_len={}, stderr_len={}",
tracing::debug!("Command completed: exit={}, stdout_len={}, stderr_len={}",
exit_code, stdout.len(), stderr.len());
if !stdout.is_empty() && stdout.len() < 1000 {
tracing::info!("Command stdout: {}", stdout.trim());
}
if !stderr.is_empty() {
tracing::warn!("Command stderr: {}", &stderr[..stderr.len().min(500)]);
}
let mut result = String::new();