From 44a0facd38159d53365a6444f4e025684add29b9 Mon Sep 17 00:00:00 2001 From: Wido den Hollander Date: Sun, 31 Mar 2013 14:14:52 +0200 Subject: [PATCH] debian: Copy management server configuration from old location Signed-off-by: Wido den Hollander --- debian/cloudstack-management.postinst | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/debian/cloudstack-management.postinst b/debian/cloudstack-management.postinst index 4e9b046caff..293810a97e7 100644 --- a/debian/cloudstack-management.postinst +++ b/debian/cloudstack-management.postinst @@ -20,7 +20,7 @@ if [ "$1" = configure ]; then if ! getent passwd cloud >/dev/null; then adduser --quiet --system --group --no-create-home --home /var/lib/cloudstack/management cloud else - usermod -m -d /var/lib/cloudstack/management cloud + usermod -m -d /var/lib/cloudstack/management cloud || true fi for i in /var/cache/cloudstack/management \ @@ -36,6 +36,20 @@ if [ "$1" = configure ]; then chgrp cloud $i done + OLDCONFDIR="/etc/cloud/management" + NEWCONFDIR="/etc/cloudstack/management" + CONFFILES="db.properties db-enc.properties cloud.keystore key" + + # Copy old configuration so the admin doesn't have to do that + # Only do so when we are installing for the first time + if [ -z "$2" ]; then + for FILE in $CONFFILES; do + if [ -f "$OLDCONFDIR/${FILE}" ]; then + cp -a $OLDCONFDIR/$FILE $NEWCONFDIR/$FILE + fi + done + fi + chmod 0640 /etc/cloudstack/management/db.properties chgrp cloud /etc/cloudstack/management/db.properties fi