Package: pdnsd
Version: 1.2.8-par-1
Severity: grave
Justification: renders package unusable

/etc/init.d/pdnsd has several problems that prevent pdnsd from starting.

Firstly line 28

test -f . /etc/default/rcS || exit 0
  
This just produces an error, '.: unexpected operator'

(I just deleted the line. I don't think /etc/default/rcS is needed at
all, there doesn't appear to be any variable from it referenced, but I
might have missed something.)



Secondly, line ~20

test -f /etc/default/$NAME

/etc/default/pdnsd is tested for, but never actually sourced. So
START_DAEMON is never set to 'yes' so the script thinks the daemon is
disabled, and never runs it.



Fixing these two at least allows the daemon to start. I also noticed
that $AUTO_MODE handling is apparently broken (although I don't use one)

if test -z "$AUTO_MODE" && test -f /usr/share/pdnsd/pdnsd-$AUTO_MODE.conf

I think the first test should be -n. -z means "is a zero-length string",
-n means "is _not_ a zero-length string".



-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.37-2-686 (SMP w/1 CPU core)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages pdnsd depends on:
ii  adduser                       3.112+nmu2 add and remove users and groups
ii  debconf [debconf-2.0]         1.5.38     Debian configuration management sy
ii  libc6                         2.11.2-11  Embedded GNU C Library: Shared lib

Versions of packages pdnsd recommends:
pn  resolvconf                    <none>     (no description available)

pdnsd suggests no packages.

-- Configuration Files:
/etc/default/pdnsd changed:
START_DAEMON=yes
AUTO_MODE=
START_OPTIONS=

/etc/init.d/pdnsd changed:
NAME="pdnsd"
DESC="proxy DNS server"
DAEMON="/usr/sbin/pdnsd"
PIDFILE="/var/run/pdnsd.pid"
CACHE="/var/cache/pdnsd/pdnsd.cache"
test -x $DAEMON || exit 0
test -f "/etc/default/$NAME" || exit 0
. /etc/default/$NAME
if test -n "$AUTO_MODE" && test -f /usr/share/pdnsd/pdnsd-$AUTO_MODE.conf
then
    START_OPTIONS="${START_OPTIONS} -c /usr/share/pdnsd/pdnsd-$AUTO_MODE.conf"
fi
. /lib/lsb/init-functions
is_yes() {
    case "$1" in
        [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|1) return 0;;
        *) return 1;
    esac
}
log_end_msg2 () {
    log_end_msg "$@"
    test $1 -eq 0 || exit 1
}
gen_cache()
{
    if ! test -f "$CACHE"; then
        mkdir -p `dirname $CACHE`
        dd if=/dev/zero of="$CACHE" bs=1 count=4 2> /dev/null
        chown -R pdnsd.proxy /var/cache/pdnsd
    fi  
}
check_pid()
{
        if test -f "$PIDFILE"; then
                log_warning_msg "pid file is exist in $PIDFILE, stop $pdnsd it 
or restart $pdnsd"
                exit 1
        fi
}
start_resolvconf()
{
    test -x /sbin/resolvconf || return
    for f in `seq 1 60`; do
        sleep 0.1
        if pdnsd-ctl status >/dev/null 2>&1; then
            break
        fi
    done
    if pdnsd-ctl status | grep -q resolvconf; then
        server=$(pdnsd-ctl status|sed -ne '/^Global:$/,/^Server.*:$/s/.*Server 
ip.*: \(.*\)$/\1/p')
        case "$server" in
            "")      ;;
            0.0.0.0) echo "nameserver 127.0.0.1" | /sbin/resolvconf -a 
"lo.$NAME";;
            *)       echo "nameserver $server"   | /sbin/resolvconf -a 
"lo.$NAME";;
        esac
    fi
}
stop_resolvconf()
{
    if [ -x /sbin/resolvconf ] ; then
        /sbin/resolvconf -d "lo.$NAME"
    fi
}
pdnsd_start()
{
    if is_yes "$START_DAEMON"; then
        check_pid
        log_begin_msg "Starting $NAME"
        start-stop-daemon --oknodo --start --quiet --pidfile "$PIDFILE" \
            --exec "$DAEMON" -- --daemon -p "$PIDFILE" $START_OPTIONS
        log_end_msg2 $?
        start_resolvconf
    else
        log_warning_msg "Not starting $NAME (disabled in /etc/default/$NAME)"
    fi
}
pdnsd_stop()
{
    log_begin_msg "Stopping $NAME"
    start-stop-daemon --oknodo --stop --quiet --user pdnsd 
--retry=TERM/3/KILL/3 --pidfile "$PIDFILE" --name "$NAME"
    start-stop-daemon --oknodo --stop --quiet --user pdnsd --retry=0/3/KILL/3 
--exec "$DAEMON" > /dev/null
    log_end_msg2 $?
    rm -f "$PIDFILE"
    stop_resolvconf
}
pdnsd_status()
{
    if status_of_proc $DAEMON $NAME; then
        /usr/sbin/pdnsd-ctl status
    fi
}
case "$1" in
    start)
        gen_cache
        pdnsd_start
        ;;
  stop)
        pdnsd_stop
  ;;
  status)
        pdnsd_status
        ;;
  restart|force-reload)
        pdnsd_stop
  pdnsd_start
        ;;
    *)
        echo "Usage: /etc/init.d/$NAME 
{start|stop|restart|force-reload|status}" >&2
        exit 1
        ;;
esac
exit 0

/etc/pdnsd.conf changed:
// Read the pdnsd.conf(5) manpage for an explanation of the options.
/* Note: this file is overriden by automatic config files when
   /etc/default/pdnsd AUTO_MODE is set and that
   /usr/share/pdnsd/pdnsd-$AUTO_MODE.conf exists
 */
// 2010-08-15: comment out server_ip to listen on all interface,
// uncomment root-servers section to do recursive resolving
global {
        perm_cache=1024;
        cache_dir="/var/cache/pdnsd";
        run_as="pdnsd";
//      server_ip = 127.0.0.1;  // Use eth0 here if you want to allow other
                                // machines on your network to query pdnsd.
        status_ctl = on;
        paranoid=on;
//      query_method=tcp_udp;   // pdnsd must be compiled with tcp
                                // query support for this to work.
        min_ttl=15m;       // Retain cached entries at least 15 minutes.
        max_ttl=1w;        // One week.
        timeout=10;        // Global timeout option (10 seconds).
        // Don't enable if you don't recurse yourself, can lead to problems
        // delegation_only="com","net";
}
/* with status_ctl=on and resolvconf installed, this will work out from the box
   this is the recommended setup for mobile machines */
/*
server {
    label="resolvconf";
}
*/
// This section is meant for resolving from root servers.
server {
        label = "root-servers";
        root_server=on;
        ip =    198.41.0.4
        ,       192.228.79.201
        ,       192.33.4.12
        ,       128.8.10.90
        ,       192.203.230.10
        ,       192.5.5.241
        ,       192.112.36.4
        ,       128.63.2.53
//      ,       192.36.148.17
//      ,       192.58.128.30
//      ,       193.0.14.129
//      ,       198.32.64.12
//      ,       202.12.27.33
        ;
        timeout = 5;
        uptest = query;
        interval = 30m;      // Test every half hour.
        ping_timeout = 300;  // 30 seconds.
        purge_cache = off;
        exclude = .localdomain;
        policy = included;
        preset = off;
}
source {
        owner=localhost;
//      serve_aliases=on;
        file="/etc/hosts";
}
rr {
        name=localhost;
        reverse=on;
        a=127.0.0.1;
        owner=localhost;
        soa=localhost,root.localhost,42,86400,900,86400,86400;
}
/*
neg {
        name=doubleclick.net;
        types=domain;   // This will also block xxx.doubleclick.net, etc.
}
*/
/*
neg {
        name=bad.server.com;   // Badly behaved server you don't want to 
connect to.
        types=A,AAAA;
}
*/
/* vim:set ft=c: */


-- debconf information:
* pdnsd/conf: Manual

-- 
http://rjy.org.uk/



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to