cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wid...@apache.org
Subject [12/50] [abbrv] git commit: updated refs/heads/kvm-vnc-listen to 3890860
Date Wed, 03 Apr 2013 10:33:20 GMT
debian: Copy management server configuration from old location

Signed-off-by: Wido den Hollander <wido@42on.com>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/44a0facd
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/44a0facd
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/44a0facd

Branch: refs/heads/kvm-vnc-listen
Commit: 44a0facd38159d53365a6444f4e025684add29b9
Parents: 35e5b8e
Author: Wido den Hollander <wido@42on.com>
Authored: Sun Mar 31 14:14:52 2013 +0200
Committer: Wido den Hollander <wido@42on.com>
Committed: Sun Mar 31 14:16:31 2013 +0200

----------------------------------------------------------------------
 debian/cloudstack-management.postinst |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/44a0facd/debian/cloudstack-management.postinst
----------------------------------------------------------------------
diff --git a/debian/cloudstack-management.postinst b/debian/cloudstack-management.postinst
index 4e9b046..293810a 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


Mime
View raw message