CLOUDSTACK-4921 : Add usage service to chkconfig
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/294b0c72 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/294b0c72 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/294b0c72 Branch: refs/heads/master Commit: 294b0c7277141569451a7f71175f91cd906a70e5 Parents: 00e57c0 Author: Kishan Kavala <[email protected]> Authored: Wed Oct 23 11:24:54 2013 +0530 Committer: Kishan Kavala <[email protected]> Committed: Wed Oct 23 16:05:12 2013 +0530 ---------------------------------------------------------------------- packaging/centos63/cloud.spec | 9 +++++++++ 1 file changed, 9 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/294b0c72/packaging/centos63/cloud.spec ---------------------------------------------------------------------- diff --git a/packaging/centos63/cloud.spec b/packaging/centos63/cloud.spec index 25979fb..ffaf4d7 100644 --- a/packaging/centos63/cloud.spec +++ b/packaging/centos63/cloud.spec @@ -486,11 +486,20 @@ if [ -f "%{_sysconfdir}/cloud.rpmsave/agent/agent.properties" ]; then mv %{_sysconfdir}/cloud.rpmsave/agent/agent.properties %{_sysconfdir}/cloud.rpmsave/agent/agent.properties.rpmsave fi +%preun usage +/sbin/service cloudstack-usage stop || true +if [ "$1" == "0" ] ; then + /sbin/chkconfig --del cloudstack-usage > /dev/null 2>&1 || true + /sbin/service cloudstack-usage stop > /dev/null 2>&1 || true +fi + %post usage if [ -f "%{_sysconfdir}/%{name}/management/db.properties" ]; then echo Replacing db.properties with management server db.properties rm -f %{_sysconfdir}/%{name}/usage/db.properties ln -s %{_sysconfdir}/%{name}/management/db.properties %{_sysconfdir}/%{name}/usage/db.properties + /sbin/chkconfig --add cloudstack-usage > /dev/null 2>&1 || true + /sbin/chkconfig --level 345 cloudstack-usage on > /dev/null 2>&1 || true fi #%post awsapi
