CLOUDSTACK-5042: change cloud.keystore to cloudmanagementserver.keystore and install it (cherry picked from commit de448ec4792eda5b47d79b26e9cb8ce96a2b22f4)

This commit is contained in:
Wei Zhou 2013-11-07 11:09:06 +01:00
parent edf04a33c1
commit 57ba367f3c
4 changed files with 14 additions and 3 deletions

View File

@ -35,7 +35,7 @@ if [ "$1" = configure ]; then
OLDCONFDIR="/etc/cloud/management"
NEWCONFDIR="/etc/cloudstack/management"
CONFFILES="db.properties cloud.keystore key"
CONFFILES="db.properties key"
# Copy old configuration so the admin doesn't have to do that
# Only do so when we are installing for the first time
@ -45,6 +45,9 @@ if [ "$1" = configure ]; then
cp -a $OLDCONFDIR/$FILE $NEWCONFDIR/$FILE
fi
done
if [ -f "$OLDCONFDIR/cloud.keystore" ]; then
cp -a $OLDCONFDIR/cloud.keystore $NEWCONFDIR/cloudmanagementserver.keystore
fi
fi
chmod 0640 /etc/cloudstack/management/db.properties

View File

@ -252,7 +252,7 @@ rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}-management/webapps/client/WEB-INF/cl
rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}-management/webapps/client/WEB-INF/classes/vms
for name in db.properties log4j-cloud.xml tomcat6-nonssl.conf tomcat6-ssl.conf server-ssl.xml server-nonssl.xml \
catalina.policy catalina.properties classpath.conf tomcat-users.xml web.xml environment.properties ; do
catalina.policy catalina.properties classpath.conf tomcat-users.xml web.xml environment.properties cloudmanagementserver.keystore ; do
mv ${RPM_BUILD_ROOT}%{_datadir}/%{name}-management/webapps/client/WEB-INF/classes/$name \
${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/management/$name
done
@ -450,6 +450,13 @@ else
echo "Unable to determine ssl settings for tomcat.conf, please run cloudstack-setup-management manually"
fi
if [ -f "%{_sysconfdir}/cloud.rpmsave/management/cloud.keystore" ]; then
mv %{_sysconfdir}/%{name}/management/cloudmanagementserver.keystore %{_sysconfdir}/%{name}/management/cloudmanagementserver.keystore.rpmnew
cp -p %{_sysconfdir}/cloud.rpmsave/management/cloud.keystore %{_sysconfdir}/%{name}/management/cloudmanagementserver.keystore
# make sure we only do this on the first install of this RPM, don't want to overwrite on a reinstall
mv %{_sysconfdir}/cloud.rpmsave/management/cloud.keystore %{_sysconfdir}/cloud.rpmsave/management/cloud.keystore.rpmsave
fi
%preun agent
/sbin/service cloudstack-agent stop || true
if [ "$1" == "0" ] ; then
@ -539,6 +546,7 @@ fi
%config(noreplace) %{_sysconfdir}/%{name}/management/cloud-bridge.properties
%config(noreplace) %{_sysconfdir}/%{name}/management/commons-logging.properties
%config(noreplace) %{_sysconfdir}/%{name}/management/ec2-service.properties
%config(noreplace) %{_sysconfdir}/%{name}/management/cloudmanagementserver.keystore
%attr(0755,root,root) %{_initrddir}/%{name}-management
%attr(0755,root,root) %{_bindir}/%{name}-setup-management
%attr(0755,root,root) %{_bindir}/%{name}-update-xenserver-licenses

View File

@ -584,7 +584,7 @@ public class ConfigurationServerImpl extends ManagerBase implements Configuratio
File confFile = PropertiesUtil.findConfigFile("db.properties");
/* This line may throw a NPE, but that's due to fail to find db.properities, meant some bugs in the other places */
String confPath = confFile.getParent();
String keystorePath = confPath + "/cloud.keystore";
String keystorePath = confPath + "/cloudmanagementserver.keystore";
File keystoreFile = new File(keystorePath);
boolean dbExisted = (dbString != null && !dbString.isEmpty());