Return-Path: X-Original-To: apmail-cloudstack-commits-archive@www.apache.org Delivered-To: apmail-cloudstack-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 917CA10974 for ; Tue, 24 Sep 2013 07:57:53 +0000 (UTC) Received: (qmail 38012 invoked by uid 500); 24 Sep 2013 07:57:32 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 37832 invoked by uid 500); 24 Sep 2013 07:57:28 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 37748 invoked by uid 99); 24 Sep 2013 07:57:26 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Sep 2013 07:57:26 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 1B7A89081F3; Tue, 24 Sep 2013 07:57:25 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: weizhou@apache.org To: commits@cloudstack.apache.org Date: Tue, 24 Sep 2013 07:57:26 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [4/4] git commit: updated refs/heads/master to 164e3e3 CLOUDSTACK-4405: change rpm and debian packaging to support automatic update (KVM upgrade) Including following steps: b. Run "cloudstack-agent-upgrade". This script will upgrade all the existing bridge name to new bridge name, and update related firewall rules. c. install a libvirt hook: c1. mkdir /etc/libvirt/hooks c2. cp /usr/share/cloudstack-agent/lib/libvirtqemuhook /etc/libvirt/hooks/qemu c3. chmod +x /etc/libvirt/hooks/qemu c4. service libvirtd restart (cherry picked from commit a0988780ad88bb56becb0a13efedcd79c1bee142) Signed-off-by: Wei Zhou Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/164e3e33 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/164e3e33 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/164e3e33 Branch: refs/heads/master Commit: 164e3e33b414861d4c49457df66dbd7a73830303 Parents: 258118e Author: Wei Zhou Authored: Tue Sep 24 09:14:15 2013 +0200 Committer: Wei Zhou Committed: Tue Sep 24 09:55:35 2013 +0200 ---------------------------------------------------------------------- debian/cloudstack-agent.postinst | 10 +++++++++- debian/rules | 2 ++ packaging/centos63/cloud.spec | 7 +++++++ 3 files changed, 18 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/164e3e33/debian/cloudstack-agent.postinst ---------------------------------------------------------------------- diff --git a/debian/cloudstack-agent.postinst b/debian/cloudstack-agent.postinst index 499ae6a..9bad138 100644 --- a/debian/cloudstack-agent.postinst +++ b/debian/cloudstack-agent.postinst @@ -34,7 +34,15 @@ case "$1" in fi done fi + + # Running cloudstack-agent-upgrade to update bridge name for upgrade from CloudStack 4.0.x (and before) to CloudStack 4.1 (and later) + /usr/bin/cloudstack-agent-upgrade + if [ ! -d "/etc/libvirt/hooks" ] ; then + mkdir /etc/libvirt/hooks + fi + cp -a /usr/share/cloudstack-agent/lib/libvirtqemuhook /etc/libvirt/hooks/qemu + /etc/init.d/libvirt-bin restart ;; esac -exit 0 \ No newline at end of file +exit 0 http://git-wip-us.apache.org/repos/asf/cloudstack/blob/164e3e33/debian/rules ---------------------------------------------------------------------- diff --git a/debian/rules b/debian/rules index 5e3d58c..26a3495 100755 --- a/debian/rules +++ b/debian/rules @@ -71,6 +71,8 @@ install: install -D packaging/debian/init/cloud-agent $(DESTDIR)/$(SYSCONFDIR)/init.d/$(PACKAGE)-agent install -D agent/target/transformed/cloud-setup-agent $(DESTDIR)/usr/bin/cloudstack-setup-agent install -D agent/target/transformed/cloud-ssh $(DESTDIR)/usr/bin/cloudstack-ssh + install -D agent/target/transformed/cloudstack-agent-upgrade $(DESTDIR)/usr/bin/cloudstack-setup-agent + install -D agent/target/transformed/libvirtqemuhook $(DESTDIR)/usr/share/$(PACKAGE)-agent/lib/ install -D agent/target/transformed/* $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/agent # cloudstack-management http://git-wip-us.apache.org/repos/asf/cloudstack/blob/164e3e33/packaging/centos63/cloud.spec ---------------------------------------------------------------------- diff --git a/packaging/centos63/cloud.spec b/packaging/centos63/cloud.spec index 90ebe4b..40c983c 100644 --- a/packaging/centos63/cloud.spec +++ b/packaging/centos63/cloud.spec @@ -463,6 +463,13 @@ fi %post agent if [ "$1" == "1" ] ; then + echo "Running %{_bindir}/%{name}-agent-upgrade to update bridge name for upgrade from CloudStack 4.0.x (and before) to CloudStack 4.1 (and later)" + %{_bindir}/%{name}-agent-upgrade + if [ ! -d %{_sysconfdir}/libvirt/hooks ] ; then + mkdir %{_sysconfdir}/libvirt/hooks + fi + cp -a ${RPM_BUILD_ROOT}%{_datadir}/%{name}-agent/lib/libvirtqemuhook %{_sysconfdir}/libvirt/hooks/qemu + /sbin/service libvirtd restart /sbin/chkconfig --add cloudstack-agent > /dev/null 2>&1 || true /sbin/chkconfig --level 345 cloudstack-agent on > /dev/null 2>&1 || true fi