Skip to content

systemd service template: set Restart=on-failure - #97

Open
mkobel wants to merge 1 commit into
CloudKrafter:mainfrom
mkobel:systemd-restart-on-failure
Open

systemd service template: set Restart=on-failure#97
mkobel wants to merge 1 commit into
CloudKrafter:mainfrom
mkobel:systemd-restart-on-failure

Conversation

@mkobel

@mkobel mkobel commented Oct 24, 2025

Copy link
Copy Markdown

Ensure restart in case of an OOM or other errors as suggested for long-running services

#96

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants