Bug/#23626 dead process showing as running #3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The state reported by systemd has been aligned with the real runtime state of rb-exporter, preventing the service from being shown as active when no pmacctd processes are running. To achieve this, the RemainAfterExit option was removed, as it caused false active states, and logic was added to detect and clean up stale pidfiles and lockfiles, returning an error code when no exporter instance can be started. With these changes, systemd correctly reflects the service state and Chef can detect failures and automatically restart rb-exporter when it is enabled from the manager.
Se ha alineado el estado reportado por systemd con el estado real de rb-exporter, evitando que el servicio aparezca como activo cuando no existen procesos pmacctd en ejecución. Para ello, se eliminó la opción RemainAfterExit, que provocaba estados falsos de ejecución, y se añadió lógica para detectar y limpiar pidfiles y lockfiles obsoletos, devolviendo un código de error cuando no se consigue arrancar ninguna instancia. Con estos cambios, systemd refleja correctamente el estado del servicio y Chef puede detectar el fallo y relanzar automáticamente rb-exporter cuando está habilitado desde el manager.