From 7ba2db86ee90ba609e41662b92440dd0b19bf46a Mon Sep 17 00:00:00 2001 From: Rositsa Kyuchukova Date: Wed, 18 Nov 2026 13:06:08 +0200 Subject: [PATCH] systemvm: keep /var/www owned by www-data after patching the SSVM Patching the secondary storage VM extracts cloud-scripts.tgz as root, which also carries /var/www/html/userdata. The folder then belongs to root and new download links (volumes, templates, ISOs) fail with "mkdir: cannot create directory ... Permission denied" until the SSVM is rebooted. Give /var/www back to www-data after the extract, the same as the boot setup does. Fixes #14726 --- systemvm/patch-sysvms.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/systemvm/patch-sysvms.sh b/systemvm/patch-sysvms.sh index e8fa06018ed4..147b9f5b1d2f 100755 --- a/systemvm/patch-sysvms.sh +++ b/systemvm/patch-sysvms.sh @@ -119,6 +119,13 @@ patch_systemvm() { echo "Extracting cloud scripts" >> $logfile 2>&1 tar -xvf $newpath/cloud-scripts.tgz -C / >> $logfile 2>&1 + if [ "$TYPE" = "secstorage" ]; then + # The archive also carries /var/www, which is extracted as root. Give it back + # to the web server user, the same as on boot, so that new download links + # can still be created under /var/www/html/userdata after the patch. + chown www-data:www-data -R /var/www + fi + if [ -f $backupfolder/conf/cloud.jks ]; then cp -r $backupfolder/conf/* /usr/local/cloud/systemvm/conf/ echo "Restored keystore file and certs using backup" >> $logfile 2>&1