CLOUDSTACK-5042: change cloud.keystore to cloudmanagementserver.keystore and install it
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/de448ec4 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/de448ec4 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/de448ec4 Branch: refs/heads/4.2 Commit: de448ec4792eda5b47d79b26e9cb8ce96a2b22f4 Parents: 0227e00 Author: Wei Zhou <[email protected]> Authored: Thu Nov 7 11:09:06 2013 +0100 Committer: Wei Zhou <[email protected]> Committed: Thu Nov 7 11:09:06 2013 +0100 ---------------------------------------------------------------------- client/tomcatconf/cloudmanagementserver.keystore | Bin 1316 -> 0 bytes client/tomcatconf/cloudmanagementserver.keystore.in | Bin 0 -> 1316 bytes debian/cloudstack-management.postinst | 5 ++++- packaging/centos63/cloud.spec | 10 +++++++++- .../com/cloud/server/ConfigurationServerImpl.java | 2 +- 5 files changed, 14 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/de448ec4/client/tomcatconf/cloudmanagementserver.keystore ---------------------------------------------------------------------- diff --git a/client/tomcatconf/cloudmanagementserver.keystore b/client/tomcatconf/cloudmanagementserver.keystore deleted file mode 100644 index 3ee4d13..0000000 Binary files a/client/tomcatconf/cloudmanagementserver.keystore and /dev/null differ http://git-wip-us.apache.org/repos/asf/cloudstack/blob/de448ec4/client/tomcatconf/cloudmanagementserver.keystore.in ---------------------------------------------------------------------- diff --git a/client/tomcatconf/cloudmanagementserver.keystore.in b/client/tomcatconf/cloudmanagementserver.keystore.in new file mode 100644 index 0000000..3ee4d13 Binary files /dev/null and b/client/tomcatconf/cloudmanagementserver.keystore.in differ http://git-wip-us.apache.org/repos/asf/cloudstack/blob/de448ec4/debian/cloudstack-management.postinst ---------------------------------------------------------------------- diff --git a/debian/cloudstack-management.postinst b/debian/cloudstack-management.postinst index a1219cc..8d99f6a 100644 --- a/debian/cloudstack-management.postinst +++ b/debian/cloudstack-management.postinst @@ -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 http://git-wip-us.apache.org/repos/asf/cloudstack/blob/de448ec4/packaging/centos63/cloud.spec ---------------------------------------------------------------------- diff --git a/packaging/centos63/cloud.spec b/packaging/centos63/cloud.spec index 26541d3..8f47ebb 100644 --- a/packaging/centos63/cloud.spec +++ b/packaging/centos63/cloud.spec @@ -266,7 +266,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 @@ -464,6 +464,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 @@ -554,6 +561,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 http://git-wip-us.apache.org/repos/asf/cloudstack/blob/de448ec4/server/src/com/cloud/server/ConfigurationServerImpl.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/server/ConfigurationServerImpl.java b/server/src/com/cloud/server/ConfigurationServerImpl.java index 10364ba..682ea7f 100755 --- a/server/src/com/cloud/server/ConfigurationServerImpl.java +++ b/server/src/com/cloud/server/ConfigurationServerImpl.java @@ -587,7 +587,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());
