From c3535880d2588782b12bb61523a53549e6c0d778 Mon Sep 17 00:00:00 2001 From: Ben <5091256+benj-n@users.noreply.github.com> Date: Fri, 26 May 2023 06:44:02 -0400 Subject: [PATCH] Create user 'cloud' in cloudstack-usage postinstall (#7559) This ensures the chown 'cloud:cloud' command (later in the same file) is always performed with no error. --- debian/cloudstack-usage.postinst | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/debian/cloudstack-usage.postinst b/debian/cloudstack-usage.postinst index 61a6b14ce32..8e262254f12 100755 --- a/debian/cloudstack-usage.postinst +++ b/debian/cloudstack-usage.postinst @@ -21,7 +21,12 @@ set -e case "$1" in configure) - + 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 || true + fi + # Linking usage server db.properties to management server db.properties if [ -f "/etc/cloudstack/management/db.properties" ]; then echo "Replacing usage server's db.properties with a link to the management server's db.properties"