Merge ~cjwatson/turnip:charm-reload-systemd-after-unmask into turnip:master

Proposed by Colin Watson
Status: Merged
Approved by: Thiago F. Pappacena
Approved revision: 77edec462df77efebc615aaaeebac5d7314d61d7
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/turnip:charm-reload-systemd-after-unmask
Merge into: turnip:master
Diff against target: 14 lines (+1/-1)
1 file modified
charm/layer/turnip-storage/lib/charms/turnip/storage.py (+1/-1)
Reviewer Review Type Date Requested Status
Thiago F. Pappacena (community) Approve
Review via email: mp+389648@code.launchpad.net

Commit message

charm: Reload systemd after unmasking srv-turnip-data.mount

Description of the change

CI is currently showing suspicious symptoms like this:

  2020-08-20 23:54:36 DEBUG nfs-relation-changed Created symlink /etc/systemd/system/srv-turnip-data.mount → /dev/null.
  2020-08-20 23:54:36 DEBUG juju-log nfs:17: Writing file /lib/systemd/system/srv-turnip-data.mount root:root 644
  2020-08-20 23:54:37 DEBUG nfs-relation-changed Removed /etc/systemd/system/srv-turnip-data.mount.
  ...
  2020-08-20 23:54:56 DEBUG amqp-relation-changed Failed to start turnip-celery.service: Unit srv-turnip-data.mount is masked.

But srv-turnip-data.mount shouldn't be masked at this point, because /etc/systemd/system/srv-turnip-data.mount (the masking symlink) was removed. systemctl(1) doesn't explicitly say that unmask has the additional effect of daemon-reload, so my best theory is that we should explicitly call daemon-reload after unmask.

To post a comment you must log in.
Revision history for this message
Thiago F. Pappacena (pappacena) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/charm/layer/turnip-storage/lib/charms/turnip/storage.py b/charm/layer/turnip-storage/lib/charms/turnip/storage.py
2index 86785fb..b4cc3ea 100644
3--- a/charm/layer/turnip-storage/lib/charms/turnip/storage.py
4+++ b/charm/layer/turnip-storage/lib/charms/turnip/storage.py
5@@ -30,8 +30,8 @@ def mount_data(mount_info):
6 context = dict(mount_info)
7 context['data_dir'] = data_dir()
8 templating.render('data.mount.j2', data_mount_conf, context, perms=0o644)
9- reload_systemd()
10 host.service('unmask', data_mount)
11+ reload_systemd()
12 host.service_restart(data_mount)
13 # systemctl shouldn't return successfully unless the mount completed,
14 # but let's make sure.

Subscribers

People subscribed via source and target branches