lobsters / lobsters-ansible

Ansible playbook for lobste.rs
ISC License
79 stars 26 forks source link

Add systemd's unicorn service #23

Closed jstoja closed 6 years ago

jstoja commented 6 years ago

This adds a systemd unit file and uses it to start/reload the app. It's enabled at startup with the enabled=yes. I didn't specify the restart always because it's not handled to my knowledge now (and that it's usually a bad idea to force restarting blindly a process).

If you have any remark, please do.

Should close #7

pushcx commented 6 years ago

This looks like it'll handle #7, thank you. Before I merge, could you elaborate on what you mean by "restart always"?

jstoja commented 6 years ago

I meant using this option in the systemd’s unit file: https://www.freedesktop.org/software/systemd/man/systemd.service.html#Restart=

If we want to enable this, I’d setup some monitoring to at least notify someone that it restarted (for example notify if restarted >= 3 in the last hour).

What do you think about this?

On 29 Apr 2018, at 04:53, Peter Bhat Harkins notifications@github.com wrote:

This looks like it'll handle #7, thank you. Before I merge, could you elaborate on what you mean by "restart always"?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

jstoja commented 6 years ago

That's a great idea and a very nice feedback! Thank you very much for this! I'm changing that ASAP :)

jstoja commented 6 years ago

I tested the automatic restart after a fail and it worked well with the burst limit 👍

pushcx commented 6 years ago

This is great to have, especially with the upcoming downtime. Thanks for tackling it, @jstoja, and thank you, @PeterFaiman for collaborating to make it more robust.