---
name: systemd_restart
kind: function
lang: go
domain: infra
version: "1.0.0"
purity: impure
signature: "func SystemdRestart(conn SSHConn, unitName string) error"
description: "Reinicia un servicio systemd en un host remoto via SSH."
tags: [systemd, restart, service, remote]
uses_functions: [ssh_exec_go_infra]
uses_types: [ssh_conn_go_infra]
returns: []
returns_optional: false
error_type: "error_go_core"
imports: [fmt]
params:
  - name: conn
    desc: "conexión SSH al host remoto"
  - name: unitName
    desc: "nombre del unit systemd a reiniciar (sin .service)"
output: "nil si el reinicio fue exitoso"
tested: false
tests: []
test_file_path: ""
file_path: "functions/infra/systemd_restart.go"
---

## Ejemplo

```go
conn := SSHConn{Host: "192.168.1.100", User: "deploy"}
if err := SystemdRestart(conn, "dag_engine"); err != nil {
    log.Fatal(err)
}
```

## Notas

Usa `sudo systemctl restart`. Requiere que el usuario SSH tenga permisos sudo. Si el servicio no existe, systemctl retorna error.
