apt-cacher-cleanup.pl loops when .conf has user=root

Bug #622161 reported by Skip Guenter
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apt-cacher (Ubuntu)
Confirmed
Medium
Unassigned

Bug Description

Binary package hint: apt-cacher

Was finding that apt-cacher-cleanup.pl had been running (I think, based on time in top) for days, maybe weeks. Found the pid and killed it. Got back onto that server tonight and found it running again (and again I think for days).

Did went to /usr/share/apt-cacher and did this and got the error on line 561:
  skip@crunch20:/usr/share/apt-cacher$ ./apt-cacher-cleanup.pl -s
  Simulation mode. Just printing what would be done.
  Could not enter the cache dir at ./apt-cacher-cleanup.pl line 561.

Did this and looped:
  skip@crunch20:/usr/share/apt-cacher$ sudo ./apt-cacher-cleanup.pl -s
  Simulation mode. Just printing what would be done.
  Invoked as root, changing to root:root and re-execing.
  Simulation mode. Just printing what would be done.
  Invoked as root, changing to root:root and re-execing.
  Simulation mode. Just printing what would be done.
  Invoked as root, changing to root:root and re-execing.
  Simulation mode. Just printing what would be done.
  Invoked as root, changing to root:root and re-execing.

I don't know perl but I think it might be this code:
# change uid and gid if root
  if ($cfg->{user} && !$> or $cfg->{group} && !$)) {
      printmsg("Invoked as root, changing to $cfg->{user}:$cfg->{group} and re-execing.\n");
      setup_ownership($cfg);
      # Rexec to ensure /proc/self/fd ownerships correct which are needed for red
      # patching with pdiffs
      exec($0, @savedARGV) or die "Unable to rexec $0: $!\n";
  }

I'm ASSUMING that $cfg is getting info from /etc/apt-cacher/apt-cacher.conf in general and in particular these two lines:
group=root
user=root

Can anyone explain when or why this was added? U believe my apt-cacher.conf has been coded like this since April of 2008 when I first installed it. The machine was recently (a couple months ago) upgraded from v8.04LTS to v10.04LTS of Xubuntu.

Running now with the "if" code above commented out and with the -s switch. It did GETs on the lists and now is "READING" all the repositories... wow, I've accumulated mucho 'stuff' in 2 years. Might consider just clearing out the cache and starting fresh.

Anyway, if anybody can tell me how I should be addressing this I'd love to hear. Thanx, Skip

Xubuntu v10.04
................................................
skip@crunch20:~$ uname -a
Linux crunch20 2.6.32-24-generic #38-Ubuntu SMP Mon Jul 5 09:20:59 UTC 2010 x86_64 GNU/Linux
................................................
skip@crunch20:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 10.04.1 LTS
Release: 10.04
Codename: lucid
................................................
skip@crunch20:~$ apt-cache policy apt-cacher
apt-cacher:
  Installed: 1.6.10ubuntu2
  Candidate: 1.6.10ubuntu2
  Version table:
 *** 1.6.10ubuntu2 0
        500 http://us.archive.ubuntu.com/ubuntu/ lucid/universe Packages
        100 /var/lib/dpkg/status
................................................
what I expected -> it to run in a timely manor (hour or two, not days)
what happened -> it ran for days

Revision history for this message
Charlie Kravetz (cjkgeek) wrote :

Thanks for reporting this bug and any supporting documentation. Since this bug has enough information provided for a developer to begin work, I'm going to mark it as confirmed and let them handle it from here. Thanks for taking the time to make Ubuntu better!

Changed in apt-cacher (Ubuntu):
importance: Undecided → Medium
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.