From da7bcf6b91a9aeee7057f884cec6e36f6457e6de Mon Sep 17 00:00:00 2001 From: Lars Erik Wik Date: Thu, 13 Nov 2025 12:40:36 +0100 Subject: [PATCH 1/2] postinstall.sh no longer fails on missing $PREFIX/httpd/htdocs/vendor After building CFEngine Enterprise Hub package with starter pack, the post install script failed during installation. Looking at the install log I saw: ``` + chown root:cfapache -R /var/cfengine/httpd/htdocs/vendor chown: cannot access '/var/cfengine/httpd/htdocs/vendor': No such file or directory ``` Ticket: ENT-12603 Signed-off-by: Lars Erik Wik --- packaging/common/cfengine-hub/postinstall.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packaging/common/cfengine-hub/postinstall.sh b/packaging/common/cfengine-hub/postinstall.sh index 6660d23c3..7df21a48a 100644 --- a/packaging/common/cfengine-hub/postinstall.sh +++ b/packaging/common/cfengine-hub/postinstall.sh @@ -996,8 +996,10 @@ chown $MP_APACHE_USER:$MP_APACHE_USER -R $PREFIX/httpd/htdocs/ldap chmod 0700 -R $PREFIX/httpd/htdocs/ldap/config # changed permissions and owner of PHP and JS dependencies -chown root:$MP_APACHE_USER -R $PREFIX/httpd/htdocs/vendor -chmod -R ug=rX,o= $PREFIX/httpd/htdocs/vendor # 440 for files, 550 for dirs +if [ -f $PREFIX/httpd/htdocs/vendor ]; then + chown root:$MP_APACHE_USER -R $PREFIX/httpd/htdocs/vendor + chmod -R ug=rX,o= $PREFIX/httpd/htdocs/vendor # 440 for files, 550 for dirs +fi ## # Start Apache server (and php-fpm if present) From 7b54e2ab1d3c8f28d4beb345b8c38df002bb712d Mon Sep 17 00:00:00 2001 From: Lars Erik Wik Date: Thu, 13 Nov 2025 12:43:43 +0100 Subject: [PATCH 2/2] postinstall.sh: fixed whitespace Signed-off-by: Lars Erik Wik --- packaging/common/cfengine-hub/postinstall.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/common/cfengine-hub/postinstall.sh b/packaging/common/cfengine-hub/postinstall.sh index 7df21a48a..0d7d9e3ff 100644 --- a/packaging/common/cfengine-hub/postinstall.sh +++ b/packaging/common/cfengine-hub/postinstall.sh @@ -1025,7 +1025,7 @@ true "Provisioning CFE_ROBOT user in the system" echo "INSERT INTO users (username, password, salt, roles) VALUES ('CFE_ROBOT', 'SHA=$CFE_ROBOT_PW_HASH', '$CFE_ROBOT_PW_SALT', '{cf_remoteagent}') ON CONFLICT (username, external) - DO UPDATE + DO UPDATE SET password = 'SHA=$CFE_ROBOT_PW_HASH', salt = '$CFE_ROBOT_PW_SALT'" | "$PREFIX/bin/psql" cfsettings ) true "Successfully provisioned CFE_ROBOT user"