-
Notifications
You must be signed in to change notification settings - Fork 33
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
run system scheduler as different user #331
Comments
How about drop in files, they can be configured by profile: https://creativeprojects.github.io/resticprofile/schedules/systemd/index.html#systemd-drop-in-files |
Thanks! |
systemd-drop-in-files seems to work, but drags some issue into the picture, like HOME folder not set properly when "User=" property is set, and this causes restic to complain about permission denied on "/root/.cache/restic" One fix is to set cache-dir on resticprofile profile. But the right way to do this probably is to switch back to "user" scheduler but enable maybe it is worth speaking about |
do you know if enable linger would make resticprofile systemd user schedule behave just like the root one does? |
No I don't know, I don't use user scheduling on any of my linux machines. But I can certainly mention it in the documentation. It's not something Have you tried it yourself? |
I had same issue, and drop in config with specifying |
User based schedules are implemented by using Changing the user automatically (so that the root scheduler can be used) adds additional complexity as secrets that may just be readable by root must be transferred into a user process. That said, systemd templates or drop-ins allow to configure it and force you to setup permissions and env so that the user context is working correctly. I do see a benefit of an automatic approach here but it is also not easy to setup and get right for a little savings in config work that could also be documented to get you started. |
root:root
To get the best of both worlds it is possible to set systemd unit to run as specific user
https://www.freedesktop.org/software/systemd/man/latest/systemd.exec.html#User=
problem can't be solved by providing systemd templates as they are declared in global section of configuration, but we need a per-user (or --profile) change (run-as username)
The text was updated successfully, but these errors were encountered: