mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-1936 add cloudstack-agent as a service
This commit is contained in:
parent
f1259d50bd
commit
542a339f96
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue