Merge ~cjwatson/launchpad:charm-librarian-fix-log-file into launchpad:master

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: 7f806716f47271a686df0e3c50b049d5d018f57c
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:charm-librarian-fix-log-file
Merge into: launchpad:master
Diff against target: 13 lines (+1/-1)
1 file modified
charm/launchpad-librarian/templates/launchpad-librarian@.service.j2 (+1/-1)
Reviewer Review Type Date Requested Status
Jürgen Gmach Approve
Review via email: mp+442770@code.launchpad.net

Commit message

charm: Fix --logfile option passed to librarian

Description of the change

The `launchpad-librarian@.service.j2` template is only rendered once, not once per worker, so we can't use the `logfile` variable here to get a per-worker log file path. Use systemd's instance name syntax to produce `--logfile {{ logs_dir }}/librarian1.log` when running `launchpad-librarian@1.service`, etc.

To post a comment you must log in.
Revision history for this message
Jürgen Gmach (jugmac00) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/charm/launchpad-librarian/templates/launchpad-librarian@.service.j2 b/charm/launchpad-librarian/templates/launchpad-librarian@.service.j2
2index 846016e..8d380ca 100644
3--- a/charm/launchpad-librarian/templates/launchpad-librarian@.service.j2
4+++ b/charm/launchpad-librarian/templates/launchpad-librarian@.service.j2
5@@ -14,7 +14,7 @@ WorkingDirectory={{ code_dir }}
6 MemoryMax=4G
7 Environment=LPCONFIG=launchpad-librarian%i
8 SyslogIdentifier=librarian
9-ExecStart={{ code_dir }}/bin/twistd --python daemons/librarian.tac --pidfile {{ var_dir }}/librarian%i.pid --prefix librarian --logfile {{ logfile }} --nodaemon
10+ExecStart={{ code_dir }}/bin/twistd --python daemons/librarian.tac --pidfile {{ var_dir }}/librarian%i.pid --prefix librarian --logfile {{ logs_dir }}/librarian%i.log --nodaemon
11 ExecReload=/bin/kill -USR1 $MAINPID
12 KillMode=mixed
13 Restart=on-failure

Subscribers

People subscribed via source and target branches

to status/vote changes: