-
Notifications
You must be signed in to change notification settings - Fork 203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PermissionError: [Errno 13] Permission denied: '/tmp/backintime.lock' #1676
Comments
Hello Kay, QuestionsExecutionCan you explain in more details how the two backup jobs (the users's and root's one) are "executed"? Manually via GUI, via commandline or schedule via crontab? For example I wonder about this.
No need to use Global lock settingsCan you have a look (as root & user) in the Manage profiles dialog in the Options tab and see if the option "Run only one snapshot at a time" is set? ReproducedIt seems I can reproduce the problem (on Debian 12 with BIT 1.4.4-dev).
This not happens when root runs first and user as second snapshot. To my team mates[removed because irrelevant] |
Hello Christian, BIT starts via udev
|
Have you configured this yourself or is this generated by BIT? I ask because I have not written that part of BIT and I don't use udev. |
The udev roles were created directly via BIT; yes the same external HDD is used. |
Yes, this option is set for both profiles. |
Am I correct in assuming that the files/folders in source and destination of the two snapshot profiles don't actually conflict with each other, but rather you want to reduce the load on the one external hard drive, so you intend for both jobs to run one after the other? Why not opening for just reading ( backintime/common/snapshots.py Line 2208 in d33f35e
Regarding to my quick n dirty tests this might solve the problem. But let's wait on my team mates with some more expertise in this than me. 😃 Note to me (hint from |
Yes, to reduce the load. If both are running in parallel, it can happen that the load goes over 20, e.g. if I'm still on YouTube, it can jerk. |
Might work, didn't test - still does not explain (for me), why a regular user can run their backup job while root cannot. |
Beside change the open mode from write to read another proposal could be to relocate the flock file itself. backintime/common/snapshots.py Line 63 in d33f35e
Can someone of you test it to modify that path to My proposal
|
I opened PR #1697. Would be glad if you could give it a try and test it in your environment. Let me know if you have further questions or if I can be of assistance. |
After I copied flock.py and snapshots.py to /usr/share/backintime/common and connected the HDD, there were no more problems with the root user's backup process. |
Great work! This looks like a bug in BiT anyhow (= not releasing a lock file) and introducing a context manager instead of using our legacy I think I need to update my locking documentation once this fix is merged... Furthermore I am wondering if the missing access rights for |
Might be the case. I couldn't find the document explaining (in human readable form) this Kernel security feature. I just found this commit message: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=30aba6656f61ed44cba445a3c0d38b296fa9e8f5 To my understanding this feature was introduced not long ago in the Linux kernel. It seems to be an attack vector if root writes to tmp-files that are not owned by root. So it is prohibited not matter how the "others" or "groups" permissions on such a file might be. Root is not allowed to write to files in |
Hello Kay, So I have to think about an alternative solution and thinking about use cases where my new solution might be a problem. What do you think? |
Hello,
I have a problem with the lock file.
First the backup of my user is executed and then always the backup of the root account.
The backup of the root user is not executed because the lock file '/tmp/backintime.lock' exists.
If I then start backintime via the console, I get the following message on the console when I click the backup button:
After removing the lock file, the backup runs without errors. The lock file is then created by Backintime as follows:
However, if the root lock file exists, there are no problems when the normal user starts a backup.
backintime --diagnostics output
The text was updated successfully, but these errors were encountered: