Merge lp:~cjwatson/turku-charms/turku-agent-charm-more-systemd-units into lp:turku-charms/turku-agent-charm

Proposed by Colin Watson
Status: Merged
Approved by: Paul Collins
Approved revision: 14
Merged at revision: 14
Proposed branch: lp:~cjwatson/turku-charms/turku-agent-charm-more-systemd-units
Merge into: lp:turku-charms/turku-agent-charm
Diff against target: 35 lines (+16/-9)
1 file modified
hooks/hooks.py (+16/-9)
To merge this branch: bzr merge lp:~cjwatson/turku-charms/turku-agent-charm-more-systemd-units
Reviewer Review Type Date Requested Status
Paul Collins lgtm Approve
Review via email: mp+369734@code.launchpad.net

Commit message

Enable new systemd units.

Description of the change

These units were added in the version of turku-agent that was synced in r14, but the installation code wasn't updated to match, so systems running systemd would never actually ask turku to perform backups.

To post a comment you must log in.
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
Paul Collins (pjdc) :
review: Approve (lgtm)
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision 14

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/hooks.py'
2--- hooks/hooks.py 2019-05-24 05:57:40 +0000
3+++ hooks/hooks.py 2019-07-04 23:45:30 +0000
4@@ -44,15 +44,22 @@
5
6 # Systemd configuration
7 if os.path.isdir('/etc/systemd/system'):
8- shutil.copyfile('files/turku-agent/turku-agent-rsyncd.service',
9- '/etc/systemd/system/turku-agent-rsyncd.service')
10- # Even if the directory exists, Systemd may not be installed or
11- # enabled. So don't fail on this systemctl command.
12- try:
13- subprocess.call(['systemctl', 'enable', 'turku-agent-rsyncd'])
14- except OSError as e:
15- if e.errno != 2:
16- raise
17+ for unit in (
18+ 'turku-agent-ping.service',
19+ 'turku-agent-ping.timer',
20+ 'turku-agent-rsyncd.service',
21+ 'turku-update-config.service',
22+ 'turku-update-config.timer',
23+ ):
24+ shutil.copyfile(os.path.join('files/turku-agent', unit),
25+ os.path.join('/etc/systemd/system', unit))
26+ # Even if the directory exists, Systemd may not be installed or
27+ # enabled. So don't fail on this systemctl command.
28+ try:
29+ subprocess.call(['systemctl', 'enable', unit])
30+ except OSError as e:
31+ if e.errno != 2:
32+ raise
33
34
35 def configure(juju_stored=None):

Subscribers

People subscribed via source and target branches

to all changes: