Skip to content

Commit 76dab96

Browse files
author
Kishan Kavala
committed
CLOUDSTACK-4921 : Add usage service to chkconfig
1 parent fa88fb1 commit 76dab96

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎packaging/centos63/cloud.spec‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,11 +495,20 @@ if [ -f "%{_sysconfdir}/cloud.rpmsave/agent/agent.properties" ]; then
495495
mv %{_sysconfdir}/cloud.rpmsave/agent/agent.properties %{_sysconfdir}/cloud.rpmsave/agent/agent.properties.rpmsave
496496
fi
497497

498+
%preun usage
499+
/sbin/service cloudstack-usage stop || true
500+
if [ "$1" == "0" ] ; then
501+
/sbin/chkconfig --del cloudstack-usage > /dev/null 2>&1 || true
502+
/sbin/service cloudstack-usage stop > /dev/null 2>&1 || true
503+
fi
504+
498505
%post usage
499506
if [ -f "%{_sysconfdir}/%{name}/management/db.properties" ]; then
500507
echo Replacing db.properties with management server db.properties
501508
rm -f %{_sysconfdir}/%{name}/usage/db.properties
502509
ln -s %{_sysconfdir}/%{name}/management/db.properties %{_sysconfdir}/%{name}/usage/db.properties
510+
/sbin/chkconfig --add cloudstack-usage > /dev/null 2>&1 || true
511+
/sbin/chkconfig --level 345 cloudstack-usage on > /dev/null 2>&1 || true
503512
fi
504513

505514
#%post awsapi

0 commit comments

Comments
 (0)