FS#78741 - [borgmatic] Add systemd user unit
Attached to Project:
Arch Linux
Opened by Cvlc12 (Cvlc) - Thursday, 08 June 2023, 22:53 GMT
Last edited by Daniel M. Capella (polyzen) - Monday, 19 June 2023, 03:41 GMT
Opened by Cvlc12 (Cvlc) - Thursday, 08 June 2023, 22:53 GMT
Last edited by Daniel M. Capella (polyzen) - Monday, 19 June 2023, 03:41 GMT
|
Details
Description:
Wouldn't it be useful to ship systemd user units on top of the system units ? i.e. (I think) add the following to the PKGBUILD? `install -Dm644 -t "$pkgdir"/usr/lib/systemd/user sample/systemd/*` Additional info: * package version(s) : 1.7.14 |
This task depends upon
Closed by Daniel M. Capella (polyzen)
Monday, 19 June 2023, 03:41 GMT
Reason for closing: Implemented
Additional comments about closing: 1.7.14-3 thanks to gromit 🚀
Monday, 19 June 2023, 03:41 GMT
Reason for closing: Implemented
Additional comments about closing: 1.7.14-3 thanks to gromit 🚀
You can find the units in /usr/lib/systemd/system/borgmatic.{service,timer} and can just use them from there as usual as systemd already looks for units in this location (you can check i.e. by running systemctl cat borgmatic.timer).
Let me know if I missed something!
Thanks, yes I was talking about user units, apparently the one provided doesn't seem to be work as is when launched with '--user', so it's not as easy as copying the unit files to "/usr/lib/systemd/user" or ~/.config/ etc...
I'm not comfortable enough with systemd to understand what needs to be changed or if that might introduce other problems or security issues unfortunately !
But it seems that the Borg docs recommend running it as non root if root is not required. It also poses problems with SSH keys, etc...
Would it make sense for the Arch package to install a similar file + timer to /usr/lib/systemd/usr ?
Otherwise I'll reference it in the wiki when I have a moment next week.
Sure. I've just checked the sample one into the borgmatic source in case that helps. (Untested by me though.)
https://projects.torsion.org/borgmatic-collective/borgmatic/src/branch/main/sample/systemd/borgmatic-user.service
Thanks !
I just checked the new PKGBUILD, but it seems wrong, it installs the system service twice. Shouldn't it be :
install -Dm644 -t "$pkgdir"/usr/lib/systemd/system/ sample/systemd/borgmatic.*
install -Dm644 -t "$pkgdir"/usr/lib/systemd/user/ sample/systemd/borgmatic-user.*
borgmatic-user.timer is a symbolic link though, so unsure if that causes any problems
I have currently prepared a MR for this (https://gitlab.archlinux.org/archlinux/packaging/packages/borgmatic/-/merge_requests/1#9b9baac1eb9b72790eef5540a1685306fc43fd6c_50_53), but since you cant view it here is the current PKGBUILD: https://gist.github.com/christian-heusel/12579bd9a2263a09051edcf6bf36caf0