2005-06-01, sze keltezéssel 13.32-kor Eduard Bloch ezt írta:
> Please set the debug variable to 1 in /etc/apt-cacher/apt-cacher.conf
> and send me the last log lines from /var/log/apt-cacher/error.log after
> triggering one of such unwanted downloads.
OK.

I decided to user kernel-source-2.6.11 as a test case, because I am sure
I have not downloaded it since the update.

Before starting the download, I said
"cp kernel-source-2.6.11_2.6.11-5_all.deb
kernel-source-2.6.11_2.6.11-5_all.deb-orig" in both
/var/cache/apt-cacher/packages and /headers, to save the current
versions I have.

Then on one of the clients, I said
"apt-get install kernel-source-2.6.11", which resulted in an
external download, and the following files in the error.log:
(removed the time-stamps)

------------------------------------------------------------------

debug: called
with 
/ftp2.de.debian.org/debian/pool/main/k/kernel-source-2.6.11/kernel-source-2.6.11_2.6.11-5_all.deb
debug: new filename with just basename:
kernel-source-2.6.11_2.6.11-5_all.deb
debug: looking
for /var/cache/apt-cacher/packages/kernel-source-2.6.11_2.6.11-5_all.deb
debug: HIT
debug:
open /var/cache/apt-cacher/packages/kernel-source-2.6.11_2.6.11-5_all.deb
debug: file is not complete
debug: fetcher: try to pick up
http://ftp2.de.debian.org/debian/pool/main/k/kernel-source-2.6.11/kernel-source-2.6.11_2.6.11-
5_all.deb
debug: Executing /usr/bin/curl -D- --stderr /dev/null
http://ftp2.de.debian.org/debian/pool/main/k/kernel-source-2.6.11/kerne
l-source-2.6.11_2.6.11-5_all.deb
debug: starting to
return /var/cache/apt-cacher/packages/kernel-source-2.6.11_2.6.11-5_all.deb
debug: no header yet...

debug: read 0 bytes
debug: read 65536 bytes
debug: wrote 65536 bytes

(repeating many times)...

debug: read 4096 bytes
debug: wrote 4096 bytes
debug: read 0 bytes
debug: pick up
http://ftp2.de.debian.org/debian/pool/main/k/kernel-source-2.6.11/kernel-source-2.6.11_2.6.11-5_all.deb
 as /va
r/cache/apt-cacher/packages/kernel-source-2.6.11_2.6.11-5_all.deb,
return code 0
debug: fetcher exiting
debug: read 65536 bytes
debug: wrote 65536 bytes
debug: read 65536 bytes
debug: wrote 65536 bytes
debug: read 65536 bytes
debug: wrote 65536 bytes
debug: read 24196 bytes
debug: wrote 24196 bytes
debug: read 0 bytes
debug: exit (file completed)


    * * *

So, it seems apt-cacher decided the file I already had was incomplete.
Now I diffed the old and new header and package files, and the package
itself is exactly the same as before, and the diff output for the header
file is this:

--- kernel-source-2.6.11_2.6.11-5_all.deb-orig  2005-06-01
22:56:17.867888288 +0200
+++ kernel-source-2.6.11_2.6.11-5_all.deb       2005-06-01
22:56:35.738171592 +0200
@@ -1,11 +1,9 @@
 HTTP/1.1 200 OK
-Date: Tue, 17 May 2005 21:54:35 GMT
+Date: Wed, 01 Jun 2005 20:56:38 GMT
 Server: Apache/2.0.53 (Debian GNU/Linux)
 Last-Modified: Tue, 17 May 2005 05:47:29 GMT
 ETag: "29c8094-2294e84-e8677e40"
 Accept-Ranges: bytes
 Content-Length: 36261508
-Keep-Alive: timeout=15, max=100
-Connection: Keep-Alive
 Content-Type: application/x-debian-package
 
--------------------------------------------------

Subsquent requests for the same file are now served from the cache.

   * * *

So, the question is, why did apt-cache think the file is imcomplete?
It was not. Is there some meta-info, which was not imported properly
from the old cache?


> How did you import the old cache?
Here is what I did:

In my old config /var/cache/apt-cacher was a link to an other directory
(let's name it /local/apt-cache for now.)

After upgrading apt-cacher, I discovered that the symlink is gone,
and there is a new directory instead.  In the new directory,
I found the 5 new subdirectories. (headers, import, packages, private,
tmp.)

I found the original archive /local/apt-cache untouched.

(At this point, I sligtly wondered what would have happened to my old
data if /var/cache/apt-cacher haooebed to be a real dir, not of a
symlink, but then I decided that I don't care, let's just make it work.)

For a first step, I pulled a few packages via the new system, without
importing anything from the old one.

They appeared in /packages, as they should.

Then I copied a few "mixed deb" file from /local/apt-cache to the
new /var/cache/apt-cacher directory, and called
/usr/share/apt-cacher/apt-cacher-format-transition.pl /var/cache/apt-cacher
to see if it goes OK. It did: the debs I copied there disappeared from
/var/cache/apt-cacher, and the demuxed package and the header appeared
in the right subdirectories. So it seemed fine.

  * * *

Here came the tricky part:

Since the old /local/apt-cacher directory and the
new /var/cache/apt-cacher directory were an different partitions, and I
did not feel like copying the >9000 .deb, I did the following:

a) I removed everything except the mixed deb files (namely, all
        subdirectories, packages/release and source files) from
        /local/apt-cache.
b) I moved the new subdirectories from /var/cache/apt-cacher to
        /local/apt-cache
c) I removed the (empty) /var/cache/apt-cacher directory
d) I simlinked /local/apt-cache to /var/cache/apt-cacher.

   * * *

(I believe the above four steps are equivalent to copying all the mixed
up debs to the new directory).

I called
/usr/share/apt-cacher/apt-cacher-format-transition.pl /var/cache/apt-cacher
again.

It run for a while, and converted my ~9500 packages nice.
At the end, all mixed-up debs were gone from /var/cache/apt-cacher (now
a simlink to /local/apt-cache, like with the old version), and the new
demuxed packages appeared in the right place.

It seemed to be fine.

(Sorry for the lengthy answer, but I did not want to omit anything I did
that might have broken the thing.)

 * * * 

>  Have you nuked old / irrelevant files?
If you mean the old mete-data (like the subdirectories
in /local/apt-cache), that as I have written above, I have.

> How many files are in /var/cache/apt-cacher/private/ ?
982.

(And 10013 in /var/cache/apt-cacher/packages.)

  * * *

One more (offtopic) thing: (maybe I should have filled a separate
bugreport, but I guess this is a more simple way):

At line 27-28, /usr/share/doc/apt-cacher/README.Debian says this:

"to use apt-cacher with apache2, symlink the file
/etc/apt/apt-cacher.conf to /etc/apache2/conf.d/apt-cacher.conf
and restart apache2."

Now I have never seen "/etc/apt/apt-cacher.conf". Should not that been
/etc/apt-cacher/apache.conf instead?

For an inexperienced user, this might be quite misleading...)

  * * * 

Best wishes:

        Kristof




-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to