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
diff --git a/hooks/hooks.py b/hooks/hooks.py
index bc7a9d2..4163151 100755
--- a/hooks/hooks.py
+++ b/hooks/hooks.py
@@ -283,10 +283,11 @@ def configure_rsync_server():
283 file_from_template("rsync-base-cfg.tmpl", "/etc/rsyncd.conf", tmpl_data)283 file_from_template("rsync-base-cfg.tmpl", "/etc/rsyncd.conf", tmpl_data)
284 file_from_template("rsync-mirrors-cfg.tmpl", os.path.join(conf.rsyncd_dir(), "010-ubuntu-mirror.conf"), tmpl_data)284 file_from_template("rsync-mirrors-cfg.tmpl", os.path.join(conf.rsyncd_dir(), "010-ubuntu-mirror.conf"), tmpl_data)
285285
286 # Need to tell systemd to enable rsync286 # Need to tell systemd to enable rsync and then start it
287 # but only in 15.04 or greater per https://wiki.ubuntu.com/SystemdForUpstartUsers287 # but only in 15.04 or greater per https://wiki.ubuntu.com/SystemdForUpstartUsers
288 if float(platform.linux_distribution()[1]) >= 15.04:288 if float(platform.linux_distribution()[1]) >= 15.04:
289 check_call('systemctl enable rsync'.split())289 check_call('systemctl enable rsync'.split())
290 check_call('systemctl start rsync'.split())
290291
291 log("CHARM: Finished configuring rsync server")292 log("CHARM: Finished configuring rsync server")
292293
@@ -814,20 +815,6 @@ def upgrade_charm():
814 install()815 install()
815816
816817
817@hooks.hook("start")
818def start():
819 log("CHARM: Starting {}".format(conf.app_name()))
820 service_start("apache2")
821 service_start("rsync")
822
823
824@hooks.hook("stop")
825def stop():
826 log("CHARM: Stopping {}".format(conf.app_name()))
827 service_stop("apache2")
828 service_stop("rsync")
829
830
831@hooks.hook("nrpe-external-master-relation-changed")818@hooks.hook("nrpe-external-master-relation-changed")
832def nrpe_external_master_relation_changed():819def nrpe_external_master_relation_changed():
833 log("CHARM: Changing nrpe relation for {}".format(conf.app_name()))820 log("CHARM: Changing nrpe relation for {}".format(conf.app_name()))
diff --git a/hooks/start b/hooks/start
834deleted file mode 120000821deleted file mode 120000
index 9416ca6..0000000
--- a/hooks/start
+++ /dev/null
@@ -1 +0,0 @@
1hooks.py
2\ No newline at end of file0\ No newline at end of file
diff --git a/hooks/stop b/hooks/stop
3deleted file mode 1200001deleted file mode 120000
index 9416ca6..0000000
--- a/hooks/stop
+++ /dev/null
@@ -1 +0,0 @@
1hooks.py
2\ No newline at end of file0\ No newline at end of file

Subscribers

People subscribed via source and target branches