--- name: systemd_local_start kind: function lang: bash domain: infra version: "1.0.0" purity: impure signature: "systemd_local_start(name: string) -> json" description: "Arranca un servicio systemd local con systemctl start. Devuelve el MainPID asignado. Requiere sudo." tags: [systemd, service, local, infra, start] 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, started:true, pid:int}. Errores a stderr, exit 1." tested: false tests: [] test_file_path: "" file_path: "bash/functions/infra/systemd_local_start.sh" --- ## Ejemplo ```bash source bash/functions/infra/systemd_local_start.sh systemd_local_start "sqlite_api" # {"name":"sqlite_api","started":true,"pid":12345} ``` ## Notas - Si el servicio ya está corriendo, `systemctl start` es idempotente (no hace nada). - El PID devuelto es el `MainPID` según systemd. 0 si el arranque falló en silencio (usar `systemd_local_status` para diagnóstico).