You are not logged in.
Hi!
I'm using aurutils as my aur helper.
The paccache.service (activated via paccache.timer) from pacman-contrib fails with the custompkgs directory (as per the aur man page). I presume this is because the directory is owned by the user (me) who is using aurutils, and the fact the paccache.service drops unneeded priviledges and/or has protect-home activated.
Jan 08 13:41:38 ArkkiVille systemd[1]: Starting Remove unused cached package files...
Jan 08 13:41:38 ArkkiVille paccache[1090718]: ==> ERROR: cachedir '/home/custompkgs' does not exist or is not a directory
Jan 08 13:41:38 ArkkiVille systemd[1]: paccache.service: Main process exited, code=exited, status=1/FAILURE
Jan 08 13:41:38 ArkkiVille systemd[1]: paccache.service: Failed with result 'exit-code'.
Jan 08 13:41:38 ArkkiVille systemd[1]: Failed to start Remove unused cached package files.
(the error message is confusing; the directory is indeed there but not seen by the service, caused by how the unit file has been written).
$ ls -ld /home/custompkgs/
drwxr-xr-x 2 ville ville 303 Jan 7 02:08 /home/custompkgs/
Now, I'm a bit confused, as to:
what would be the most sensible way to fix this? Perhaps I just should just set ProtectHome to no, and call it a day?
Should I report this upstream (be that aurutils or pacman-contrib?), or is this just some quirk / edge case the user should deal with by themself?
I can confirm that solution 1. actually works for me, and I believe I can trust paccache it will not ruin my user home directories.
Last edited by Wild Penguin (2024-02-18 15:04:59)
Offline
For clarity :
You added /home/custompkgs to Cachedir in pacman.conf ?
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
(A works at time B) && (time C > time B ) ≠ (A works at time C)
Offline
Yes, as per aur man page.
# An example of a custom package repository. See the pacman manpage for
# tips on creating your own repositories.
[custom]
SigLevel = Optional TrustAll
Server = file:///home/custompkgs
This package repo directory is owned by a user (as aur is intended to run as a non-privileged user).
Last edited by Wild Penguin (2024-01-08 19:54:18)
Offline
That doesn't answer my question, rephrasing .
Did you follow the CacheDir (optional) section and add /home/custompkgs to pacman.conf Cachedir variable ?
Please post your /etc/pacman.conf so your pacman setup is clear.
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
(A works at time B) && (time C > time B ) ≠ (A works at time C)
Offline
Ah, yes. I though it is clear:
The paccache.service (activated via paccache.timer) from pacman-contrib fails with the custompkgs directory (as per the aur man page).
That code block is from my pacman.conf, I forgot to mention it.
Offline
Hi
I have a similar issue and would also like discuss possible solutions, so let see if we can get this conversation running again ;-)
Here are the relevant parts of my pacman.conf.
[options]
CacheDir = /var/cache/pacman/pkg/ /home/xyz/aurutils/
--- snip ---
[custom]
SigLevel = Never TrustAll
Server = file:///home/xyz/aurutils
I am attempting a divide and conquer approach with a system service, a user service and a pair of related overrides.
Limit the system service to pacman's own cache:
# cat /etc/systemd/system/paccache.service.d/override.conf
[Service]
ExecStart=
ExecStart=/usr/bin/paccache -r -v -c /var/cache/pacman/pkg/
Make the service and timer available to users:
# ln -sv /usr/lib/systemd/system/paccache.{service,timer} /etc/systemd/user/
'/etc/systemd/user/paccache.service' -> '/usr/lib/systemd/system/paccache.service'
'/etc/systemd/user/paccache.timer' -> '/usr/lib/systemd/system/paccache.timer'
Hardcode the aurutils path and unset ProtectHome for the user service:
# cat /home/xyz/.config/systemd/user/paccache.service.d/override.conf
[Service]
ExecStart=
ExecStart=/usr/bin/paccache -r -v -c /home/xyz/aurutils
ProtectHome=no
The -v switch is only a matter on preference: the list of deleted files is sent to the journal.
The system service runs fine (some backlog, yes...):
paccache[pid]: ==> finished: 9980 packages removed (disk space saved: 80.61 GiB)
For the user service on the other hand, it starts fine, but I do not have enough history there yet for a functional test:
paccache[pid]: ==> no candidate packages found for pruning
The trade-off:
++ the security around the root user is kept up,
-- at the cost of a hard-coded path abandoned by all the beauty in the world,,
-- and some minor additional complexity due to the multiplication of services.
A simpler solution could be to move the aurutils directory somewhere out of /home.
- /aurutils is pretty much guaranteed not to interfere with anything, although it brings some mess to the root filesystem.
- /var/cache/pacman/aurutils would look tidy, but it is arguably more than a cache
- /var/local/aurutils ?
Or a mix, where the work directory stays where it is, but PKGDEST=/var/cache/pacman/aurutils in /etc/makepkg.conf...?
Offline
This is my override:
/etc/systemd/system/paccache.service.d/override.conf
[Service]
ExecStart=
ExecStart=/usr/bin/paccache -rk2
ProtectHome=read-only
ReadWriteDirectories=/home/merell/git/packages
I did this back in 2022, and haven't had any problems at all.
Eenie meenie, chili beanie, the spirits are about to speak -- Bullwinkle J. Moose
It's a big club...and you ain't in it -- George Carlin
Registered Linux user #149839
perl -e 'print$i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10); '
Offline
Ah yes, much better.
Thanks Merlock.
Offline
Thanks for the suggestions, I believe merlocks solutions is the cleanest. I'm not sure if upstream is aware / should be notified (for a change in the man page?).
Marking as [SOLVED]!
Offline