Merge lp:~roadmr/charms/xenial/gunicorn/restart-harder into lp:~ubuntuone-hackers/charms/xenial/gunicorn/trunk

Proposed by Daniel Manrique
Status: Merged
Approved by: Daniel Manrique
Approved revision: 46
Merged at revision: 45
Proposed branch: lp:~roadmr/charms/xenial/gunicorn/restart-harder
Merge into: lp:~ubuntuone-hackers/charms/xenial/gunicorn/trunk
Diff against target: 29 lines (+11/-0)
2 files modified
config.yaml (+7/-0)
templates/systemd.tmpl (+4/-0)
To merge this branch: bzr merge lp:~roadmr/charms/xenial/gunicorn/restart-harder
Reviewer Review Type Date Requested Status
Guillermo Gonzalez Approve
Review via email: mp+380984@code.launchpad.net

Commit message

Add restart_on_failure setting to restart on failure :)

This applies only to systemd configuration and can be managed via a juju setting. Upstart config is obsolete at this point but it already had (non-controllable) respawn behavior so this looks like just fixing a regression.

Description of the change

Add restart_on_failure setting to restart on failure :)

This applies only to systemd configuration and can be managed via a juju setting. Upstart config is obsolete at this point but it already had (non-controllable) respawn behavior so this looks like just fixing a regression.

To post a comment you must log in.
46. By Daniel Manrique

It's the booleans

Revision history for this message
Guillermo Gonzalez (verterok) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'config.yaml'
--- config.yaml 2016-10-10 13:07:21 +0000
+++ config.yaml 2020-03-20 19:41:15 +0000
@@ -113,3 +113,10 @@
113 description: >113 description: >
114 Path to gunicorn. Defaults to system.114 Path to gunicorn. Defaults to system.
115 Use if run in venv.115 Use if run in venv.
116 restart_on_failure:
117 type: boolean
118 default: false
119 description: >
120 If true, the systemd service will restart after 30 seconds
121 if it exits abnormally (see Restart= on-failure in
122 systemd.service man page)
116123
=== modified file 'templates/systemd.tmpl'
--- templates/systemd.tmpl 2018-10-31 13:18:40 +0000
+++ templates/systemd.tmpl 2020-03-20 19:41:15 +0000
@@ -16,6 +16,10 @@
16ExecReload=/bin/kill -s HUP $MAINPID16ExecReload=/bin/kill -s HUP $MAINPID
17ExecStop=/bin/kill -s TERM $MAINPID17ExecStop=/bin/kill -s TERM $MAINPID
18PrivateTmp=true18PrivateTmp=true
19{% if restart_on_failure %}
20Restart=on-failure
21RestartSec=30
22{% endif %}
1923
20[Install]24[Install]
21WantedBy=multi-user.target25WantedBy=multi-user.target

Subscribers

People subscribed via source and target branches