RosiKyu opened a new pull request, #14727:
URL: https://github.com/apache/cloudstack/pull/14727
### Description
After `patchSystemVm` on the secondary storage VM, creating a new download
link (volume, template, ISO) fails with "mkdir: cannot create directory
'/var/www/html/userdata/{id}/': Permission denied" until the SSVM is rebooted.
The patch extracts `cloud-scripts.tgz` as root, and the archive also carries
`/var/www/html/userdata`, so the folder ends up owned by root. The SSVM creates
the download folders there as `www-data`. On boot, `setup_apache2` runs `chown
www-data:www-data -R /var/www`, which is why a reboot fixes it.
This PR does the same `chown` in `patch-sysvms.sh` right after the extract,
for the secondary storage VM only.
Fixes #14726
### Types of changes
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] New feature (non-breaking change which adds functionality)
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] Enhancement (improves an existing feature and functionality)
- [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
- [ ] Build/CI
- [ ] Test (unit or integration test code)
### Feature/Enhancement Scale or Bug Severity
#### Bug Severity
- [ ] BLOCKER
- [ ] Critical
- [x] Major
- [ ] Minor
- [ ] Trivial
### How Has This Been Tested?
KVM lab on a main nightly (one SSVM, NFS secondary storage). The changed
`patch-sysvms.sh` was put on the KVM host that runs the SSVM, in place of the
packaged one.
- Without the fix: patch the SSVM, then download template T1. It fails with
"Permission denied".
- With the fix: patch the SSVM, then download template T2. The link is
created and the file is served (HTTP 206 for a range request). `/var/www`,
`/var/www/html` and `/var/www/html/userdata` are owned by `www-data` after the
patch.
#### How did you try to break this feature and the system with this change?
- The SSVM agent comes back Up after the patch with the fix.
- Only the secondary storage VM is changed. The console proxy and routers
are patched as before.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]