FS#39880 - [pkgfile] should carry a cache file update service

Attached to Project: Arch Linux
Opened by Jan (medhefgo) - Tuesday, 15 April 2014, 17:14 GMT
Last edited by Dave Reisner (falconindy) - Thursday, 17 April 2014, 15:30 GMT
Task Type Feature Request
Category Packages: Extra
Status Closed
Assigned To Dave Reisner (falconindy)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

To make pkgfile more useful, the pkgfile package should carry a update service that is triggered by a timer like the one below.

[Unit]
Description=Update pkgfile cache
RequiresMountsFor=/var/cache/pkgfile
[Service]
Type=oneshot
ExecStart=/usr/bin/mkdir -m 0755 -p /var/cache/pkgfile
ExecStart=/usr/bin/pkgfile --update
PrivateTmp=true
PrivateDevices=true
CapabilityBoundingSet=
Nice=19

[Unit]
Description=Weekly pkgfile cache update
[Timer]
OnCalendar=weekly
AccuracySec=12h
Persistent=true
This task depends upon

Closed by  Dave Reisner (falconindy)
Thursday, 17 April 2014, 15:30 GMT
Reason for closing:  Fixed
Additional comments about closing:  Upstream: https://github.com/falconindy/pkgfile/co mmit/1b7af32b712b9e2de
Comment by Dave Reisner (falconindy) - Tuesday, 15 April 2014, 19:35 GMT
pkgfile itself needs some changes to go with this as to not spam the journal.
Comment by Jan (medhefgo) - Wednesday, 16 April 2014, 16:43 GMT
Not necessarily, at least for me the journal didn't get spammed, but mostly useful messages. One could run in with --quiet too if it's really that much of a problem.
Comment by Dave Reisner (falconindy) - Wednesday, 16 April 2014, 16:52 GMT
Not sure what you tried, but it's definitely spammy. You can easily see the effects by just piping pkgfile through cat:

$ pkgfile -uu | cat
:: Updating 10 repos...
download complete: falconindy [ 33.6 KiB 494K/s 9 remaining]
:: Updating 10 repos...
download complete: falconindy [ 33.6 KiB 494K/s 9 remaining]
download complete: multilib-testing [ 29.0 B 287B/s 8 remaining]
:: Updating 10 repos...
download complete: falconindy [ 33.6 KiB 494K/s 9 remaining]
download complete: multilib-testing [ 29.0 B 287B/s 8 remaining]
download complete: community-testing [ 14.1 KiB 87.8K/s 7 remaining]
:: Updating 10 repos...
download complete: falconindy [ 33.6 KiB 494K/s 9 remaining]
download complete: multilib-testing [ 29.0 B 287B/s 8 remaining]
download complete: community-testing [ 14.1 KiB 87.8K/s 7 remaining]
download complete: testing [ 29.6 KiB 105K/s 6 remaining]
:: Updating 10 repos...
download complete: falconindy [ 33.6 KiB 494K/s 9 remaining]
download complete: multilib-testing [ 29.0 B 287B/s 8 remaining]
download complete: community-testing [ 14.1 KiB 87.8K/s 7 remaining]
download complete: testing [ 29.6 KiB 105K/s 6 remaining]
download complete: community-staging [ 88.3 KiB 304K/s 5 remaining]
etc.....

> One could run in with --quiet too if it's really that much of a problem.
This has zero effect on updates...
Comment by Jan (medhefgo) - Wednesday, 16 April 2014, 20:37 GMT
You're right about that. Adding
StandardOutput=null
StandardError=journal
does the trick for me, though. I still get error messages if any happen while getting rid of the spam.

Also, this adds some more paranoid security to the service that might be worth adding:
ReadOnlyDirectories=/
ReadWriteDirectories=/var/cache
Comment by Dave Reisner (falconindy) - Wednesday, 16 April 2014, 20:46 GMT
Ah, right.

I'll add this to the upstream repo. It doesn't really need to be an Arch only thing.

Loading...