Skip to content

Commit 44a0fac

Browse files
committed
debian: Copy management server configuration from old location
Signed-off-by: Wido den Hollander <wido@42on.com>
1 parent 35e5b8e commit 44a0fac

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

debian/cloudstack-management.postinst

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ if [ "$1" = configure ]; then
2020
if ! getent passwd cloud >/dev/null; then
2121
adduser --quiet --system --group --no-create-home --home /var/lib/cloudstack/management cloud
2222
else
23-
usermod -m -d /var/lib/cloudstack/management cloud
23+
usermod -m -d /var/lib/cloudstack/management cloud || true
2424
fi
2525

2626
for i in /var/cache/cloudstack/management \
@@ -36,6 +36,20 @@ if [ "$1" = configure ]; then
3636
chgrp cloud $i
3737
done
3838

39+
OLDCONFDIR="/etc/cloud/management"
40+
NEWCONFDIR="/etc/cloudstack/management"
41+
CONFFILES="db.properties db-enc.properties cloud.keystore key"
42+
43+
# Copy old configuration so the admin doesn't have to do that
44+
# Only do so when we are installing for the first time
45+
if [ -z "$2" ]; then
46+
for FILE in $CONFFILES; do
47+
if [ -f "$OLDCONFDIR/${FILE}" ]; then
48+
cp -a $OLDCONFDIR/$FILE $NEWCONFDIR/$FILE
49+
fi
50+
done
51+
fi
52+
3953
chmod 0640 /etc/cloudstack/management/db.properties
4054
chgrp cloud /etc/cloudstack/management/db.properties
4155
fi

0 commit comments

Comments
 (0)