---
name: systemd_local_restart
kind: function
lang: bash
domain: infra
version: "1.0.0"
purity: impure
signature: "systemd_local_restart(name: string) -> json"
description: "Reinicia un servicio systemd local con systemctl restart. Útil tras actualizar el binario o cambiar el unit. Requiere sudo."
tags: [systemd, service, local, infra, restart]
uses_functions: []
uses_types: []
returns: []
returns_optional: false
error_type: "error_go_core"
imports: []
params:
  - name: name
    desc: "nombre del servicio sin sufijo .service"
output: "JSON {name, restarted:true, pid:int}. Errores a stderr, exit 1."
tested: false
tests: []
test_file_path: ""
file_path: "bash/functions/infra/systemd_local_restart.sh"
---

## Ejemplo

```bash
source bash/functions/infra/systemd_local_restart.sh
systemd_local_restart "sqlite_api"
# {"name":"sqlite_api","restarted":true,"pid":54321}
```

## Notas

- Si modificaste el unit, primero ejecuta `sudo systemctl daemon-reload` (o llama a `systemd_local_install_unit` que ya lo hace).
- Equivalente a stop+start pero systemd lo gestiona atómicamente.
