You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by da...@apache.org on 2023/05/26 10:44:11 UTC

[cloudstack] branch 4.18 updated: Create user 'cloud' in cloudstack-usage postinstall (#7559)

This is an automated email from the ASF dual-hosted git repository.

dahn pushed a commit to branch 4.18
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/4.18 by this push:
     new c3535880d25 Create user 'cloud' in cloudstack-usage postinstall (#7559)
c3535880d25 is described below

commit c3535880d2588782b12bb61523a53549e6c0d778
Author: Ben <50...@users.noreply.github.com>
AuthorDate: Fri May 26 06:44:02 2023 -0400

    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"