apt-cacher-ng init script does not work with tmpfs /var/run directory

Bug #623635 reported by GeekSmith
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apt-cacher-ng (Ubuntu)
Fix Released
Medium
Unassigned
Nominated for Hardy by Rolf Leggewie

Bug Description

Binary package hint: apt-cacher-ng

If /var/run is mounted as tmpfs, apt-cacher-ng does not start on boot. The problem is line 37 of /etc/init.d/apt-cacher-ng:
rm -rf "$RUNDIR" || return 1

That directory does not exist on boot, so the script fails before starting the daemon. I suggest replacing this line with:
[ -d $RUNDIR ] && rm -rf "$RUNDIR" || return 1

Thanks!

@@ron

ProblemType: Bug
Architecture: amd64
Date: Tue Aug 24 14:44:40 2010
DistroRelease: Ubuntu 8.04
Package: apt-cacher-ng 0.1.9-1
PackageArchitecture: amd64
ProcEnviron:
 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/username/bin:/opt/slickedit/bin:/home/username/bin:/sbin:/usr/sbin:/usr/local/sbin:/home/username/bin
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: apt-cacher-ng
Uname: Linux 2.6.24-28-generic x86_64

Tags: apport-bug
Revision history for this message
GeekSmith (lixo-geeksmith) wrote :
Rolf Leggewie (r0lf)
Changed in apt-cacher-ng (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Rolf Leggewie (r0lf) wrote :

FWIW, I think I don't experience this problem in lucid, seems to be the old-by-now hardy package. The hardy package has quite a few problems. You may want to try the lucid version which I backported to hardy. It's available in my stable PPA.

https://launchpad.net/~r0lf/+archive/stable

Revision history for this message
Rolf Leggewie (r0lf) wrote :

not an issue in the latest dev or stable release. opening hardy task.

Changed in apt-cacher-ng (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Rolf Leggewie (r0lf) wrote :

Geeksmith, the change you propose does not look proper to me. If $RUNDIR isn't yet available, then calling "install -d --mode=0755 -o $NAME -g $NAME "$RUNDIR" || return 1" which is the next line after the one you patched isn't likely to work reliably as intended.

Revision history for this message
GeekSmith (lixo-geeksmith) wrote :

You're correct...I noticed that my fix didn't work after my last reboot, but not for the reason you specified. The original version of the script removes the directory unconditionally. The "-d" argument to the install command causes the directory to be created, so the directory's absence is not an issue.

Rather than use the short conditional, I used a full conditional and it seems to work.

   if [ -d "$RUNDIR" ]; then
      rm -rf "$RUNDIR" || return 1
   fi

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.