Bug#650726: apt-cacher-ng: starts before bind9 - can't resolve BindAddress

December 02nd, 2011 - 06:40 am ET by Richard Boardman | Report spam
Package: apt-cacher-ng
Version: 0.5.1-3
Severity: important
Tags: d-i

apt-cacher-ng runs on the same server as bind9.
In /etc/apt-cacher-ng/acng.conf, BindAddress is configured as 'localhost'
and server FQDN.
In /etc/rc*.d/ apt-cacher-ng starts (at S16) before bind9 (at S17), so the
server FQDN cannot be resolved to an IP address. This results in the daemon
listening only on localhost (loopback) ipv4 and ipv6 addresses, refusing
connections from other devices on the LAN.
While this can be worked around, with entries in /etc/hosts or by a short
sleep in /etc/defaults/apt-cacher-ng, this should not be necessary. This
could also affect proxy configuration, presumably.
Perhaps apt-cacher-ng should start at the same time as squid3 (at S18) and
other network services.

regards

Richard Boardman

Debian Release: 6.0.3
APT prefers stable
APT policy: (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages apt-cacher-ng depends on:
ii adduser 3.112+nmu2 add and remove users and groups
ii debconf [debconf-2.0] 1.5.36.1 Debian configuration
management sy
ii libbz2-1.0 1.0.5-6 high-quality block-sorting
file co
ii libc6 2.11.2-10 Embedded GNU C Library:
Shared lib
ii libfuse2 2.8.4-1.1 Filesystem in USErspace library
ii libgcc1 1:4.4.5-8 GCC support library
ii libstdc++6 4.4.5-8 The GNU Standard C++ Library v3
ii zlib1g 1:1.2.3.4.dfsg-3 compression library - runtime

Versions of packages apt-cacher-ng recommends:
ii ed 1.4-3 The classic UNIX line editor
ii perl 5.10.1-17squeeze2 Larry Wall's Practical
Extraction

apt-cacher-ng suggests no packages.

/etc/apt-cacher-ng/acng.conf changed [not included]
/etc/apt-cacher-ng/backends_debian changed [not included]
/etc/apt-cacher-ng/security.conf [Errno 13] Permission denied:
u'/etc/apt-cacher-ng/security.conf'
/etc/default/apt-cacher-ng changed [not included]






To UNSUBSCRIBE, email to debian-bugs-dist-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
email Follow the discussionReplies 2 repliesReplies Make a reply

Replies

#1 Eduard Bloch
December 12th, 2011 - 05:30 pm ET | Report spam

tags 650726 + pending
thanks

New init file attached, test it if you like to.

Thanks,
Eduard.


#! /bin/sh
### BEGIN INIT INFO
# Provides: apt-cacher-ng
# Required-Start: $local_fs $network $remote_fs
# Required-Stop: $local_fs $network $remote_fs
# Should-Start: bind9
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Apt-Cacher NG package proxy
# Description: This script powers up the package proxy daemon
### END INIT INFO

# Author: Eduard Bloch

test -r /etc/default/rcS && . /etc/default/rcS
test -r /lib/lsb/init-functions && . /lib/lsb/init-functions

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/apt-cacher-ng
NAME=apt-cacher-ng
DESC=apt-cacher-ng

test -x $DAEMON || exit 0

# Include apt-cacher-ng defaults if available
if [ -f /etc/default/apt-cacher-ng ] ; then
. /etc/default/apt-cacher-ng
fi

test -z "$DISABLED" || exit 0

# our runtime state files directory, will be purged on startup!
RUNDIR="/var/run/$NAME"

PIDFILE="$RUNDIR/pid"
SOCKETFILE="$RUNDIR/socket"
DAEMON_OPTS="$DAEMON_OPTS pidfile=$PIDFILE SocketPath=$SOCKETFILE foreground=0 $EXTRA_ACNG_OPTS "

do_start() {
PIDOF=$(pidof apt-cacher-ng)
if [ -n "$PIDOF" ] && [ -e "$PIDFILE" ] && [ "$PIDOF" = "$(cat $PIDFILE)" ] ; then
return 255
fi
rm -rf "$RUNDIR" || return 1
install -d --mode55 -o $NAME -g $NAME "$RUNDIR" || return 1
start-stop-daemon --start --chuid $NAME --group $NAME --quiet --pidfile $PIDFILE --exec $DAEMON -- $DAEMON_OPTS
}

do_stop() {

if ! start-stop-daemon --stop --retry 15 --quiet --pidfile $PIDFILE \
then
if ! test -e "$PIDFILE" && ! start-stop-daemon --stop \
then
return $?
fi
fi
rm -f $PIDFILE
return 0

}

case "$1" in
start)
log_daemon_msg "Starting $DESC" "$NAME"
do_start
log_end_msg $?
;;
stop)
log_daemon_msg "Stopping $DESC" "$NAME"
do_stop
log_end_msg $?
;;
restart|force-reload)
log_daemon_msg "Restarting $DESC" "$NAME"
do_stop
do_start
log_end_msg $?
;;
status)
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
;;
*)
echo "Usage: $0 {start|stop|status|restart|force-reload}" >&2
exit 3
;;
esac

:




To UNSUBSCRIBE, email to
with a subject of "unsubscribe". Trouble? Contact

Similar topics