-
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
[Errno 13] Permission denied: '/run/lock/backintime.lock' (on Arch) #1743
Comments
Hello d-laumer, Thank you for taking the time to report the bug and providing the details. I appreciate your feedback. Please contact the maintainer of your package. If he confirms that this is an upstream issue feel free to report back and reopen the issue.
What is this Question need to be answered by Arch maintainers:
btw: /tmp is not an option for several reasons. For example root itself has no write permission (no matter what the filesystem says!) to it on modern linux systems. Best regards, |
Hi buhtz, Thank you very much for the quick response! I did skip a bit ahead, removed the AUR package and tried to install backintime from the Github repository directly using the instructions under https://github.com/bit-team/backintime/blob/dev/CONTRIBUTING.md#build--install. However, when running the About your questions to the Arch maintainers, it seems they're simply following the systemd upstream in this point (as does Fedora), while Ubuntu and Debian do have a world-writable /run/lock using a different mechanism than systemd-tmpfiles due to historic reasons. After some more digging I found a related issue in the systemd tracker with an answer from Lennart Poettering himself. He suggests to use an own folder under Kind regards (About the - in my ls output: I forgot I have |
Thanks for reporting back and doing research. |
Hi, As I understand it, systemd provides a small tool called Using this tmpfiles mechanism, one could use a file Kind regards |
Is this "tmpfiles mechanism" related to systemd? So on systems without systemd this won't work? |
It would not inherently related to systemd as the init system, as both the systemd-tmpfiles binary can be used independently of the rest of the stack (done by e.g. Artix, Gentoo or Devuan), and alternative implementations of the same specification like opentmpfiles or tmpfilesd do exist. While possibly being quick to implement (generate new lock folder via tmpfiles, adjust flock.py accordingly), I do agree this might not be the cleanest solution due to having to rely on some OS functionality which might be there or not at all, anyway requiring some kind of fallback. |
I still don't get it why there are several applications involved. The file system structure is defined by the OS itself, like /home/user, ~/.confg, etc. Isn't there an alternative existing folder Arch-based systems? |
Ah, I see. The problem with /run is that (likely) it is a tmpfs stored in RAM and as such folders inside it like /run/lock have to be recreated on every boot, which can be done centrally using the tmpfiles tool. On a persistent file system, using it would of course not be required. I don't think Arch has a well-defined folder for what backintime is doing, user-owned stuff goes into /run/user/UID, while root-owned things seem to mostly go into /run directly so it is all separated. There might be something hidden somewhere but so far I haven't found anything. |
I have a running Arch VM now and will do some tests. I think I have an idea. |
Dear d-laumer, My assumptionsMy hypothesis is that it does not hurt if the mult-iuser-flock is not available in all cases. Having an "global flock" working for multiple users is IMHO a rare use case. Don't worry, I don't want to remove that. 😆 In another issue user described to me that he need this feature to reduce load on his extern USB-device. His two backup jobs, one for user and one for root, are started at the same time via an udev rule. I can not imagine another user case. Someone else? Additionally I assuming that files from root and user are separated from each other. So there is not risk creating file conflicts when a root and user job running at the same time. Of course some exceptional (but rare) cases are imaginable. Proposed solutionOn Arch-like systems where regular users don't have write access to If root is never used with BIT the user-instance of BIT will create a user-specific-flock (e.g. in On systems like Arch the multi-user-flock will be available only when BIT-root is used. On systems like Debian where the user is able to create/write |
By the way. Do you have enabled the option Run only one snapshot at a time in the Options tab of the Manage profiles (or Profile Settings) dialog? EDIT: There is a pending PR #1756 fixing the problem(s). I did test it with Manjaro (an Arch-based distro) with success. Could you test it with your system, too? Please make sure that you enable the option Run only one snapshot at a time. |
Hi buhtz, Sorry for taking my time coming back to you, some life stuff happened. Using the code from #1756 seems to work perfectly fine for me, both with and without using the option you suggested. Kind regards |
Hi everyone,
I run the AUR package
backintime-git
on an up-to-date EndeavourOS installation. Since #1697 was merged, I unfortunately can not run my backups (which usually run automatically) as a user anymore (and I don't use backintime as/for root) as the moved lock file can not be written to the/run/lock
folder:Permissions for the /run/lock folder:
The
/etc/tmpfiles.d
folder is empty,/usr/lib/tmpfiles.d/legacy.conf
contains the linewhich matches the permissions of the created folder and also matches systemd's standard behaviour according to their git logs. To me it seems that this folder is actually not intended to be written to by the user in the default configuration (and only contains mostly device-specific stuff for me). Instead, user processes mostly create their lock files either in
/tmp
(which was done before and lead to #1697) or in/run/user/UID
. However, using this folder (or folders for multi-user setups) for backintime as well likely clashes with the intention of having a global lock file for all users simultaneously.I am not sure how to solve this problem in the best way. As a start, one could probably add some additional fallbacks to the lockfile locations in
flock.py
in case/run/lock
is unwritable (including the old/tmp
or/run/user/UID
), however for a true global lock this likely needs some more work as mentioned (maybe some kind of daemon the backintime processes are communicating with).Another thing I want to note: I only noticed the missing permissions for the lock file after triggering a manual backup (not
backup-job
). It might be a good idea to throw a desktop notification in case the lock couldn't be gathered (like when some data has no read permissions) such that the user can act accordingly.Thanks a lot and kind regards
For completion, here's the output for
backintime --diagnostics
:The text was updated successfully, but these errors were encountered: