aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2021-06-02 13:49:05 +0200
committerGravatar Christian Hesse <mail@eworm.de>2023-11-24 08:31:59 +0100
commitcc57e3469b9475e06ab1d5fd2093e1ae563e54eb (patch)
tree37019c5c7307de7e24a029f22569f60c7f5c1938 /README.md
parent2abd33d55c18da4af4ac7540c12598527eb2a81a (diff)
downloadpacredir-cc57e3469b9475e06ab1d5fd2093e1ae563e54eb.tar.gz
pacredir-cc57e3469b9475e06ab1d5fd2093e1ae563e54eb.tar.zst
add a CacheServer entry in pacman configuration snippet...pacman-v6.1.0
... comment the regular server entry and update the documentation in README file. The server error limit was introduced in pacman 6.0.0, which caused some trouble with pacredir: Returning 404 (not found) is common case and no fatal error. This should be fixed with pacman 7.0.0, that will understand CacheServer in configuration. Hopefully. Add the required bits in include file for pacman.
Diffstat (limited to 'README.md')
-rw-r--r--README.md79
1 files changed, 17 insertions, 62 deletions
diff --git a/README.md b/README.md
index 69a278c..4a20c63 100644
--- a/README.md
+++ b/README.md
@@ -54,7 +54,17 @@ definitions in `pacman.conf`:
> Include = /etc/pacman.d/pacredir
-Do not worry if `pacman` reports:
+To get a better idea what happens in the background have a look at
+[the request flow chart](FLOW.md).
+
+### Databases from cache server
+
+By default databases are not fetched from cache servers. To make that
+happen just add the server twice, additionally as regular server. This
+is prepared in `/etc/pacman.d/pacredir`, just uncomment the corresponding
+line.
+
+Do not worry if `pacman` reports the following after the change:
> error: failed retrieving file 'core.db' from 127.0.0.1:7077 : The
> requested URL returned error: 404 Not Found
@@ -66,74 +76,19 @@ Please note that `pacredir` redirects to the most recent database file
found on the local network if it is not too old (currently 24 hours). To
make sure you really do have the latest files run `pacman -Syu` *twice*.
-To get a better idea what happens in the background have a look at
-[the request flow chart](FLOW.md).
-
Current caveat
--------------
-With its latest release `pacman` now supports a *server error limit*: Three
-download errors from a server results in the server being skipped for the
-remainder of this transaction.
+With `pacman`'s latest major release `6.x` it now supports a
+*server error limit*: Three download errors from a server results in the
+server being skipped for the remainder of this transaction.
However `pacredir` sends a "*404 - not found*" response if the file is not
available in local network - and is skipped after just three misses.
-This new feature is not configurable at runtime, so rebuilding `pacman` with
-one of the following patches is the way to make things work with `pacredir`.
-
-### Disable server error limit
-
-This is the simplest workaround - just disable the server error limit.
-
- --- a/lib/libalpm/dload.c
- +++ b/lib/libalpm/dload.c
- @@ -60,7 +60,7 @@ static int curl_gethost(const char *url, char *buffer, size_t buf_len);
-
- /* number of "soft" errors required to blacklist a server, set to 0 to disable
- * server blacklisting */
- -const unsigned int server_error_limit = 3;
- +const unsigned int server_error_limit = 0;
-
- struct server_error_count {
- char server[HOSTNAME_SIZE];
-
-We can agree this is not to be desired - in general the feature is reasonable.
-
-### Support http header to indicate a soft failure
-
-This solution is simple, yet powerful:
-[Support http header 'Cache-Control: no-cache' for soft failure](patches/0001-support-http-header-Cache-Control-no-cache-for-soft-failure.patch)
-
-By setting the HTTP header `Cache-Control: no-cache` when returning with
-the status code `404` (not found) the server can indicate that this is a
-soft failure. No error message is shown, and server's error count is
-not increased.
-
-Sadly upstream denied, again.
-
-Anyway, pushed this as merge request to Gitlab, which was closed without
-merging. 😢
-
-~~[support http header 'Cache-Control: no-cache' for soft failure](https://gitlab.archlinux.org/pacman/pacman/-/merge_requests/76)~~
-
-### Implement CacheServer
-
-A more complex solution that breaks current API is:
-[Implement CacheServer](patches/0001-implement-CacheServer.patch)
-
-This implements a new configuration option `CacheServer`. Adding a cache
-server makes it ignore the server error limit.
-
-Handling for soft failures is demanded in a long standing upstream bug, and
-the given patch could solve it:
-[FS#23407 - Allow soft failures on Server URLs](https://bugs.archlinux.org/task/23407)
-
-Pushed this as merge request to Gitlab:
-[implement CacheServer](https://gitlab.archlinux.org/pacman/pacman/-/merge_requests/74)
-
-Looks like this is going to be closed as well, but Andrew opened a merge
-request with his own implementation:
+Currently there is a merge request to
[add cache server support](https://gitlab.archlinux.org/pacman/pacman/-/merge_requests/98)
+to `pacman`. That would resolve the situation, so let's hope that will be
+merged soon and is available with `pacman` version `7.x`.
Security
--------