Hallo Mark,

I was able to pinpoint the problem but my perl knowledge is too limited
to provide a fix.

In line 1642 of /usr/sbin/apt-cacher the check is done, and for that 
$statfs->{used} + (new-content-file) is checked against the
configuration. $statfs->{used} is set via df($cfg->{'cache_dir'}, 1)

However, http://search.cpan.org/~iguthrie/Filesys-Df-0.92/Df.pm
tell however, that 
"{used} = Total blocks used on the filesystem."
and not the total blocks used in the given directory.

With that read i modified the info message to give me also

info_message('ALARM: ' . $statfs->{used} .' Insuffient space for
Content-Length: '.
$response->header('Content-Length').
' in cache_dir with ' . $statfs->{bavail} . ' available space');

and I get 
Tue Oct  9 18:59:05 2012|info [16035]: ALARM: 161367425024 Insuffient
space for Content-Length: 48398 in cache_dir with 58364964864 available
space

This pretty much matches du -sb /srv and I think this is the reason why
this check fails.

When using the perl line you submitted, I can confirm that the result is
independent of the directory given as argument.

coldtobi.

>  perl -MFilesys::Df -MData::Dumper -e 'print Dumper df "/srv/apt-cacher",1'

# perl -MFilesys::Df -MData::Dumper -e 'print Dumper df
"/srv/apt-cacher",1'
$VAR1 = {
          'user_files' => 13434880,
          'bfree' => '58364964864',
          'blocks' => '219732389888',
          'user_fused' => 48953,
          'files' => 13434880,
          'bavail' => '58364964864',
          'user_favail' => 13385927,
          'su_bavail' => '58364964864',
          'fper' => 0,
          'su_favail' => 13385927,
          'per' => 73,
          'favail' => 13385927,
          'fused' => 48953,
          'su_blocks' => '219732389888',
          'user_blocks' => '219732389888',
          'ffree' => 13385927,
          'used' => '161367425024',
          'su_files' => 13434880,
          'user_used' => '161367425024',
          'user_bavail' => '58364964864'
        };

# perl -MFilesys::Df -MData::Dumper -e 'print Dumper df "/srv/",1'
$VAR1 = {
          'user_files' => 13434880,
          'bfree' => '58364964864',
          'blocks' => '219732389888',
          'user_fused' => 48953,
          'files' => 13434880,
          'bavail' => '58364964864',
          'user_favail' => 13385927,
          'su_bavail' => '58364964864',
          'fper' => 0,
          'su_favail' => 13385927,
          'per' => 73,
          'favail' => 13385927,
          'fused' => 48953,
          'su_blocks' => '219732389888',
          'user_blocks' => '219732389888',
          'ffree' => 13385927,
          'used' => '161367425024',
          'su_files' => 13434880,
          'user_used' => '161367425024',
          'user_bavail' => '58364964864'
        };


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

Reply via email to