systemd service template: set Restart=on-failure - #97
Conversation
Ensure restart in case of an OOM or other errors as suggested for long-running services CloudKrafter#96
| ExecStop={{ nexus_installation_dir }}/nexus-latest/bin/nexus stop | ||
| User={{ nexus_os_user }} | ||
| Restart=on-abort | ||
| Restart=on-failure |
There was a problem hiding this comment.
I've had several discussions with a platform team. Restarting nexus automatically can be risky, especially when Nexus is in a undesired/broken state. Instead of automatically restarting, you want to take control of the situation, and move on with manual intervention.
There was a problem hiding this comment.
Thank you for your feedback. Is it possible to determine unsafe states? Or is it best practice to do perform a supervised manual start after every crash?
There was a problem hiding this comment.
It really depends on your setup, disaster recovery procedures and backups.
For example, we've bumped into a few situations where Nexus failed to finalize an upgrade and corrupted the database. When we started Nexus it wiped some crucial data from the database in order to restore.
Sonatype support recommended us to investigate the root cause of a production outage, before starting the server.
If you have your logs stored externally, and have access to full backups, I would understand you may want to have a sort of auto healing / recovery option.
It's just too risky to enable such as feature in this Ansible collection.
Ensure restart in case of an OOM or other errors as suggested for long-running services
#96