You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ko...@apache.org on 2013/04/08 15:13:27 UTC

[17/55] [abbrv] git commit: updated refs/heads/cisco-vnmc-api-integration to f38be48

CLOUDSTACK-1936 add cloudstack-agent as a service


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/542a339f
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/542a339f
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/542a339f

Branch: refs/heads/cisco-vnmc-api-integration
Commit: 542a339f967f504fbb7c203743808123209a4fce
Parents: f1259d5
Author: David Nalley <da...@gnsa.us>
Authored: Thu Apr 4 09:37:13 2013 -0400
Committer: David Nalley <da...@gnsa.us>
Committed: Thu Apr 4 09:38:10 2013 -0400

----------------------------------------------------------------------
 packaging/centos63/cloud.spec |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/542a339f/packaging/centos63/cloud.spec
----------------------------------------------------------------------
diff --git a/packaging/centos63/cloud.spec b/packaging/centos63/cloud.spec
index a98b643..aa4a15c 100644
--- a/packaging/centos63/cloud.spec
+++ b/packaging/centos63/cloud.spec
@@ -396,6 +396,13 @@ if [ -L $oldtomcatconf ] ; then
     fi
 fi
 
+%preun agent
+/sbin/service cloudstack-agent stop || true
+if [ "$1" == "0" ] ; then
+    /sbin/chkconfig --del cloudstack-agent > /dev/null 2>&1 || true
+    /sbin/service cloudstack-agent stop > /dev/null 2>&1 || true
+fi
+
 %pre agent
 
 # save old configs if they exist (for upgrade). Otherwise we may lose them
@@ -405,6 +412,10 @@ if [ -d "%{_sysconfdir}/cloud" ] ; then
 fi
 
 %post agent
+if [ "$1" == "1" ] ; then
+    /sbin/chkconfig --add cloudstack-agent > /dev/null 2>&1 || true
+    /sbin/chkconfig --level 345 cloudstack-agent on > /dev/null 2>&1 || true
+fi
 
 # if saved configs from upgrade exist, copy them over
 if [ -f "%{_sysconfdir}/cloud.rpmsave/agent/agent.properties" ]; then