Werk #11868: mkbackup: Fix permission issues when backing up different sites

Component Core & setup
Title mkbackup: Fix permission issues when backing up different sites
Date Jan 11, 2021
Level Trivial Change
Class Bug Fix
Compatibility Compatible - no manual interaction needed
Checkmk versions & editions
2.1.0b1 Checkmk Raw (CRE), Checkmk Enterprise (CEE), Checkmk MSP (CME)
2.0.0b5 Checkmk Raw (CRE), Checkmk Enterprise (CEE), Checkmk MSP (CME)
1.6.0p21 Checkmk Raw (CRE), Checkmk Enterprise (CEE), Checkmk MSP (CME)

The site and appliance backup functionality of Checkmk share a global lock which ensures that only a single backup or restore job is running at a time.

However, on current linux distributions, a permission issue may occur when backing up multiple sites on a single Checkmk server. The problem appears when one site creates the global lock file (/tmp/mkbackup.lock), locks it and releases the lock after the backup. The file is kept after that. Once another site tries to lock the file during it's backup, a "Permission denied" error is raised. This is caused by specific file restrictions in directories where the sticky bit is set.

The lock file has now been moved to /var/lock/mkbackup/mkbackup.lock to solve this issue.

To the list of all Werks