Open buhtz opened 3 weeks ago
How to test this? Is see "INFO: Lock" and "INFO: Unlock". Is that it?
Hello Willem, thanks for the reply and your efforts to test it. Not having an exception/crash is nice to hear. 😄
How to test this? Is see "INFO: Lock" and "INFO: Unlock". Is that it?
You should make sure to activate Run only one snapshot at a time in the Options tab of the Manage profiles (or Profile Settings) dialog? This need to be done for your users BIT profile and for your roots BIT profile.
Run BIT in terminal with --debug
option. If BIT doesn't crash, great! 🤣 On Arch running as user, you should find a message like this in the terminal output.
DEBUG: [common/flock.py:67 GlobalFlock._log] Set flock /run/user/1000/backintime.flock by PID 1234.
...
DEBUG: [common/flock.py:67 GlobalFlock._log] Release flock /run/user/1000/backintime.flock by PID 1234.
If running as root the path is different.
DEBUG: [common/flock.py:67 GlobalFlock._log] Set flock /run/lock/backintime.flock by PID 1234.
...
DEBUG: [common/flock.py:67 GlobalFlock._log] Release flock /run/lock/backintime.flock by PID 1234.
When running again as user, after running it as root, the path should also be /run/lock.
Checked it on Arch in Distrobox, as a non-root user. Also does not crash. (Running as root would require more setup.)
The global flock context manager (introduced in #1679) now fall back to single-user mode if not enough permissions available to create an flock file accessible by other users and root. The multi-user mode will be activate later until BIT is started as root for the first time. It will create an flock file accessible by all users. That behavior is relevant for Arch-based systems but not relevant on Debian-based systems because regular users have enough permissions to /run/lock. See the docstring for technical details.
It also fix a bug (introduced with #1679) ignoring the config value of
global.use_flock
.Additionally I modified and fixed the Sphinx config to make all necessary information about this behavior available in the generated HTML documentation.
Fix #1743 Fix #1751