--- name: systemd_local_uninstall kind: function lang: bash domain: infra version: "1.0.0" purity: impure signature: "systemd_local_uninstall(name: string) -> json" description: "Detiene, deshabilita y elimina el unit file de un servicio systemd local. Idempotente: no falla si el servicio ya está parado o el unit no existe. Requiere sudo." tags: [systemd, service, local, infra, uninstall, cleanup, pendiente-usar] 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, uninstalled:true}. Errores a stderr, exit 1." tested: false tests: [] test_file_path: "" file_path: "bash/functions/infra/systemd_local_uninstall.sh" --- ## Ejemplo ```bash source bash/functions/infra/systemd_local_uninstall.sh systemd_local_uninstall "sqlite_api" # {"name":"sqlite_api","uninstalled":true} ``` ## Notas - Secuencia: stop → disable → rm unit → daemon-reload → reset-failed. - `stop` y `disable` con `|| true` para idempotencia (si ya no estaba corriendo/enabled, no es error). - `reset-failed` limpia el estado "failed" si el servicio había fallado previamente.