Merge ~lgp171188/turnip:fix-logrotate-conf-turnip-api-two-service-reloads into turnip:master

Proposed by Guruprasad
Status: Merged
Approved by: Guruprasad
Approved revision: 84067d8a498bdd6951ad8e2c79b2e8e1794f8415
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~lgp171188/turnip:fix-logrotate-conf-turnip-api-two-service-reloads
Merge into: turnip:master
Diff against target: 31 lines (+2/-14)
1 file modified
charm/turnip-api/templates/logrotate.j2 (+2/-14)
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Review via email: mp+440736@code.launchpad.net

Commit message

Use a single logrotate config block for turnip api log files

This fixes the issue of the turnip-api service getting reloaded twice, once for each log file specified.

LP: #2015860

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) wrote :

We also need to add `sharedscripts`, conventionally just before `postrotate`. This causes the `postrotate` script to only be run once, rather than once per file.

review: Needs Fixing
Revision history for this message
Guruprasad (lgp171188) :
Revision history for this message
Colin Watson (cjwatson) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/charm/turnip-api/templates/logrotate.j2 b/charm/turnip-api/templates/logrotate.j2
2index 17b96ea..a5d216c 100644
3--- a/charm/turnip-api/templates/logrotate.j2
4+++ b/charm/turnip-api/templates/logrotate.j2
5@@ -1,17 +1,4 @@
6-{{ base_dir }}/logs/turnip-api-access.log {
7- rotate 90
8- daily
9- dateext
10- delaycompress
11- compress
12- missingok
13- create 0644 {{ user }} {{ group }}
14- postrotate
15- service turnip-api reload
16- endscript
17-}
18-
19-{{ base_dir }}/logs/turnip-api-error.log {
20+{{ base_dir }}/logs/turnip-api-access.log {{ base_dir }}/logs/turnip-api-error.log {
21 rotate 90
22 daily
23 dateext
24@@ -19,6 +6,7 @@
25 compress
26 missingok
27 create 0644 {{ user }} {{ group }}
28+ sharedscripts
29 postrotate
30 service turnip-api reload
31 endscript

Subscribers

People subscribed via source and target branches