From e1ccbfbee34edef8ca25c36df6ed0c929dfdf721 Mon Sep 17 00:00:00 2001 From: Andrija Panic <45762285+andrijapanicsb@users.noreply.github.com> Date: Fri, 22 Nov 2019 20:43:47 +0100 Subject: [PATCH] debian: fix symlink issue post install/upgrade (#3695) Clean up redundant/colliding decision --- debian/cloudstack-usage.postinst | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/debian/cloudstack-usage.postinst b/debian/cloudstack-usage.postinst index 95297119d2c..e51a305dcc3 100755 --- a/debian/cloudstack-usage.postinst +++ b/debian/cloudstack-usage.postinst @@ -21,15 +21,10 @@ set -e case "$1" in configure) - # We copy the db.properties file from the management server to the usage server - # This used to be a symlink, but we don't do that anymore - if [ -f "/etc/cloud/management/db.properties" ]; then - cp -a /etc/cloud/management/db.properties /etc/cloudstack/usage/db.properties - fi - - # Replacing db.properties with management server db.properties + + # Linking usage server db.properties to management server db.properties if [ -f "/etc/cloudstack/management/db.properties" ]; then - rm -rf /etc/cloudstack/usage/db.properties + rm -f /etc/cloudstack/usage/db.properties ln -s /etc/cloudstack/management/db.properties /etc/cloudstack/usage/db.properties fi @@ -40,7 +35,7 @@ case "$1" in # Replacing key with management server key if [ -f "/etc/cloudstack/management/key" ]; then - rm -rf /etc/cloudstack/usage/key + rm -f /etc/cloudstack/usage/key ln -s /etc/cloudstack/management/key /etc/cloudstack/usage/key fi ;;