Merge ~pjdc/ubuntu-mirror-charm/+git/ubuntu-mirror-charm:start-rsync-after-enabling into ubuntu-mirror-charm:master

Proposed by Paul Collins
Status: Merged
Approved by: Barry Price
Approved revision: ef3a1fcbd321a21828d4c627de36a07f95887d96
Merged at revision: 9ee3925ba4a2c8d5fc227276d185d9e49028681d
Proposed branch: ~pjdc/ubuntu-mirror-charm/+git/ubuntu-mirror-charm:start-rsync-after-enabling
Merge into: ubuntu-mirror-charm:master
Diff against target: 54 lines (+2/-16)
2 files modified
dev/null (+0/-1)
hooks/hooks.py (+2/-15)
Reviewer Review Type Date Requested Status
Barry Price Approve
Canonical IS Reviewers Pending
Review via email: mp+380935@code.launchpad.net

Commit message

start rsync after we enable it. get rid of the pointless start and stop hooks

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
Barry Price (barryprice) wrote :

+1

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

Change successfully merged at revision 9ee3925ba4a2c8d5fc227276d185d9e49028681d

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/hooks/hooks.py b/hooks/hooks.py
2index bc7a9d2..4163151 100755
3--- a/hooks/hooks.py
4+++ b/hooks/hooks.py
5@@ -283,10 +283,11 @@ def configure_rsync_server():
6 file_from_template("rsync-base-cfg.tmpl", "/etc/rsyncd.conf", tmpl_data)
7 file_from_template("rsync-mirrors-cfg.tmpl", os.path.join(conf.rsyncd_dir(), "010-ubuntu-mirror.conf"), tmpl_data)
8
9- # Need to tell systemd to enable rsync
10+ # Need to tell systemd to enable rsync and then start it
11 # but only in 15.04 or greater per https://wiki.ubuntu.com/SystemdForUpstartUsers
12 if float(platform.linux_distribution()[1]) >= 15.04:
13 check_call('systemctl enable rsync'.split())
14+ check_call('systemctl start rsync'.split())
15
16 log("CHARM: Finished configuring rsync server")
17
18@@ -814,20 +815,6 @@ def upgrade_charm():
19 install()
20
21
22-@hooks.hook("start")
23-def start():
24- log("CHARM: Starting {}".format(conf.app_name()))
25- service_start("apache2")
26- service_start("rsync")
27-
28-
29-@hooks.hook("stop")
30-def stop():
31- log("CHARM: Stopping {}".format(conf.app_name()))
32- service_stop("apache2")
33- service_stop("rsync")
34-
35-
36 @hooks.hook("nrpe-external-master-relation-changed")
37 def nrpe_external_master_relation_changed():
38 log("CHARM: Changing nrpe relation for {}".format(conf.app_name()))
39diff --git a/hooks/start b/hooks/start
40deleted file mode 120000
41index 9416ca6..0000000
42--- a/hooks/start
43+++ /dev/null
44@@ -1 +0,0 @@
45-hooks.py
46\ No newline at end of file
47diff --git a/hooks/stop b/hooks/stop
48deleted file mode 120000
49index 9416ca6..0000000
50--- a/hooks/stop
51+++ /dev/null
52@@ -1 +0,0 @@
53-hooks.py
54\ No newline at end of file

Subscribers

People subscribed via source and target branches