CacheDir setting ignored

Bug #1279021 reported by bekks on 2014-02-11
30
This bug affects 6 people
Affects Status Importance Assigned to Milestone
apt-cacher-ng (Ubuntu)
Undecided
Unassigned

Bug Description

Setting the following line in /etc/apt-cacher-ng/acng.conf

CacheDir: /data/apt-cacher-ng

is completely ignored, even after stopping/starting the apt-cache-ng service. All cached contents are still saved at /var/cache/apt-cacher-ng/

The only workaround for me so far is to create a symlink from /data/apt-cacher-ng to /var/cache/apt-cacher-ng/

My system environment looks like this:

root@serverproxy:/var/log/apt-cacher-ng# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu Trusty Tahr (development branch)
Release: 14.04
Codename: trusty

root@serverproxy:/var/log/apt-cacher-ng# apt-cache policy apt-cacher-ng
apt-cacher-ng:
  Installed: 0.7.25-1
  Candidate: 0.7.25-1
  Version table:
 *** 0.7.25-1 0
        500 http://192.168.1.51:3142/archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
        100 /var/lib/dpkg/status

Eduard Bloch (edi-gmx) wrote :

Reading NEWS.Debian for you:

apt-cacher-ng (0.7.24-1) unstable; urgency=low

  * Starting with version 0.7.23-1, there is a new sequence of Debconf dialogs
    for basic settings (CacheDir, Port, Proxy and BindAdresses). They are
    stored in an additional *.conf file overriding the settings from acng.conf
    but there is also a way to disable this override.

Julian Taylor (jtaylor) wrote :

hit this too on upgrade, breaking working setups is not nice ...
why is it ignoring its main configuration file by default?

Also I would prefer .d config files like with most programs instead of having to create some random new file in the config directory (or read up on how to automate debconf)

Eduard Bloch (edi-gmx) wrote :

Which upgrade? 0.7.24 or 0.7.25? .24 might have had a problem but .25 should be alright (just tested, cannot reproduce). Otherwise... provide logs, provide configs, or it didn't happen.

And about "read up"... Lol, just automating debconf somehow by the usual manuals (which only deal with easy single-config-file cases) is not even the half way here. The hard part is to meet the expectations of users who already used multiple config files (and guess what, acng hat it's own scheme already in place without another .d/ hack) and also want to configure some things via debconf but keep others managed manually, and typically different users have different wishes.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in apt-cacher-ng (Ubuntu):
status: New → Confirmed
Niko Ehrenfeuchter (he1ix) wrote :

I can confirm this is still there with 0.7.27-1. Just create a directory somewhere else, assign the correct permissions, put it into the "CacheDir" setting of ACNG, restart the service - the new dir won't be used.

Eduard Bloch (edi-gmx) wrote :

Maybe you messed up the permissions of the CONFIG files so your changed setting just cannot be read?

Try this:
sudo -u apt-cacher-ng apt-cacher-ng debug=7 foreground=1 port=31111

And watch the messages. If there is still the old setting visible at the end, add "strace -o /tmp/acng.log" between apt-cacher-ng's and attach acng.log here.

Immo W (immo-wetzel) wrote :

Seems to be quite silence here...
Let me attache the strace cos I have the same issue...

Eduard Bloch (edi-gmx) wrote :

And what's inside /etc/apt-cacher-ng/zz_debconf.conf ?

desrt (desrt) wrote :

Same bug here and, indeed:

zz_debconf.conf:CacheDir: /var/cache/apt-cacher-ng # default or overridden since '/var/cache/apt-cacher-ng' directory didn't exist

I spent more time than I care to admit tracking this problem down and this situation is pretty frustrating.

I particularly love this part:

# To override this values permanently, put the assignments into a file
# like /etc/apt-cacher-ng/zzz_override.conf .

Of course.

Hallo,
* Allison Ryan Lortie [Thu, Oct 22 2015, 12:09:47PM]:
> Same bug here and, indeed:
>
> zz_debconf.conf:CacheDir: /var/cache/apt-cacher-ng # default or
> overridden since '/var/cache/apt-cacher-ng' directory didn't exist
>
> I spent more time than I care to admit tracking this problem down and
> this situation is pretty frustrating.
>
> I particularly love this part:
>
> # To override this values permanently, put the assignments into a file
> # like /etc/apt-cacher-ng/zzz_override.conf .
>
> Of course.

So, which solution do you prefer that would appease both, the debconf
lovers and the "I want to hack the stuff into the config file I know and
it gotta work or else" party?

Regards,
Eduard.

Sean Wheller (seanwhe) wrote :
Download full text (3.7 KiB)

I can confirm that this bug still exists.

Linux ops-jhb-infra-06 4.4.0-64-generic #85-Ubuntu SMP Mon Feb 20 11:50:30 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

apt-cacher-ng:
  Installed: 0.9.1-1ubuntu1
  Candidate: 0.9.1-1ubuntu1
  Version table:
 *** 0.9.1-1ubuntu1 500
        500 http://za.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages
        100 /var/lib/dpkg/status

/etc/apt-cacher-ng/acng.conf

# Storage directory for downloaded data and related maintenance activity.
#
CacheDir: /mnt/data/apt-cacher-ng

ls -lash /mnt/data/
total 38K
4.0K drwxr-xr-x 7 root root 4.0K Feb 28 17:18 .
4.0K drwxr-xr-x 6 root root 4.0K Feb 24 11:44 ..
4.0K drwxr-sr-x 2 apt-cacher-ng apt-cacher-ng 4.0K Feb 26 18:59 apt-cacher-ng
 16K drwx------ 2 root root 16K Feb 23 19:34 lost+found
<snip/>

After restarting and even rebooting package cachdir remains at
/var/cache/apt-cacher-ng

My hack solution until this problem is fixed upstream:

mv /var/cache/apt-cacher-ng /home/sean

ln -s /mnt/data/apt-cacher-ng /var/cache/apt-cacher-ng

mv apt-cacher-ng/* /mnt/data/apt-cacher-ng/

ls -lash /var/cache/apt-cacher-ng
0 lrwxrwxrwx 1 root root 24 Mar 2 09:21 /var/cache/apt-cacher-ng -> /mnt/data/apt-cacher-ng/

ls -lash /mnt/data/apt-cacher-ng/
total 160K
4.0K drwxr-sr-x 13 apt-cacher-ng apt-cacher-ng 4.0K Mar 2 09:18 .
4.0K drwxr-xr-x 7 root root 4.0K Feb 28 17:18 ..
4.0K drwxr-sr-x 3 apt-cacher-ng apt-cacher-ng 4.0K Mar 2 07:53 192.168.21.17
4.0K drwxr-sr-x 4 apt-cacher-ng apt-cacher-ng 4.0K Mar 1 21:19 archive.canonical.com
4.0K drwxr-sr-x 2 apt-cacher-ng apt-cacher-ng 4.0K Feb 27 08:16 changelogs.ubuntu.com
   0 -rw-r--r-- 1 apt-cacher-ng apt-cacher-ng 0 Mar 2 06:25 _expending_damaged
108K -rw-r--r-- 1 apt-cacher-ng apt-cacher-ng 105K Mar 2 06:25 _expending_dat
4.0K drwxr-sr-x 3 apt-cacher-ng apt-cacher-ng 4.0K Feb 26 20:45 packages.elastic.co
4.0K drwxr-sr-x 3 apt-cacher-ng apt-cacher-ng 4.0K Feb 28 22:42 pkg.jenkins-ci.org
4.0K drwxr-sr-x 6 apt-cacher-ng apt-cacher-ng 4.0K Feb 28 05:45 ppa.launchpad.net
4.0K drwxr-sr-x 3 apt-cacher-ng apt-cacher-ng 4.0K Feb 28 06:42 repo.percona.com
4.0K drwxr-sr-x 3 apt-cacher-ng apt-cacher-ng 4.0K Feb 26 20:45 security.ubuntu.com
4.0K drwxr-sr-x 4 apt-cacher-ng apt-cacher-ng 4.0K Feb 26 20:50 uburep
4.0K drwxr-sr-x 3 apt-cacher-ng apt-cacher-ng 4.0K Feb 26 20:45 www.ftp.saix.net
4.0K drwxr-sr-x 3 apt-cacher-ng apt-cacher-ng 4.0K Feb 27 15:33 www.ubnt.com

ls -lash /var/cache/apt-cacher-ng/
total 160K
4.0K drwxr-sr-x 13 apt-cacher-ng apt-cacher-ng 4.0K Mar 2 09:18 .
4.0K drwxr-xr-x 7 root root 4.0K Feb 28 17:18 ..
4.0K drwxr-sr-x 3 apt-cacher-ng apt-cacher-ng 4.0K Mar 2 07:53 192.168.21.17
4.0K drwxr-sr-x 4 apt-cacher-ng apt-cacher-ng 4.0K Mar 1 21:19 archive.canonical.com
4.0K drwxr-sr-x 2 apt-cacher-ng apt-cacher-ng 4.0K Feb 27 08:16 changelogs.ubuntu.com
   0 -rw-r--r-- 1 apt-cacher-ng apt-cacher-ng 0 Mar 2 06:25 _expending_damaged
108K -rw-r--r-- 1 apt-cacher-ng apt-cacher-ng 105K Mar 2 06:25 _expending_dat
4.0K drwxr-sr-x 3 apt-cacher-ng apt-cacher-ng 4.0K Feb 26 20:45 packages.elastic.co
4...

Read more...

Sean Gilroy (seangilroy) wrote :

Issue still exists, using version 0.9.1-1ubuntu1

Implemented the fix suggested by 'seanwhe' above and is caching to my preferred directory.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments