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
1=== modified file 'config.yaml'
2--- config.yaml 2016-10-10 13:07:21 +0000
3+++ config.yaml 2020-03-20 19:41:15 +0000
4@@ -113,3 +113,10 @@
5 description: >
6 Path to gunicorn. Defaults to system.
7 Use if run in venv.
8+ restart_on_failure:
9+ type: boolean
10+ default: false
11+ description: >
12+ If true, the systemd service will restart after 30 seconds
13+ if it exits abnormally (see Restart= on-failure in
14+ systemd.service man page)
15
16=== modified file 'templates/systemd.tmpl'
17--- templates/systemd.tmpl 2018-10-31 13:18:40 +0000
18+++ templates/systemd.tmpl 2020-03-20 19:41:15 +0000
19@@ -16,6 +16,10 @@
20 ExecReload=/bin/kill -s HUP $MAINPID
21 ExecStop=/bin/kill -s TERM $MAINPID
22 PrivateTmp=true
23+{% if restart_on_failure %}
24+Restart=on-failure
25+RestartSec=30
26+{% endif %}
27
28 [Install]
29 WantedBy=multi-user.target

Subscribers

People subscribed via source and target branches