[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#37810: dpkg: start-stop-daemon should have an option to _create_ the pid file



Package: dpkg
Version: 1.4.0.34
Severity: wishlist

Given that I want to log any dns traffic on my ippp0 line. I have the
following script in /etc/ppp/ip.d/dns-tcpdump:

|#!/bin/bash
|
|PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|NAME="tcpdump-dns"
|DAEMON="/usr/local/sbin/tcpdump"
|PARM="-l -s 256 -vvv -i $PPP_IFACE udp port 53"
|
|case "$PPP_OPERATION" in
|  up)
|  	logger -t $PPP_IFACE "starting tcpdump"
|  	echo "logging DNS traffic on $PPP_IFACE" >> /var/log/dns-tcpdump
|	start-stop-daemon --start --quiet \
|		--pidfile /var/run/$NAME.pid \
|		--exec $DAEMON -- $PARM >> /var/log/dns-tcpdump &
|	logger -t $PPP_IFACE "started tcpdump with pid `cat /var/run/$NAME.pid`"
|  	;;
|  down)
|  	logger -t $PPP_IFACE "killing tcpdump with pid `cat /var/run/$NAME.pid`"
|	start-stop-daemon --stop --quiet \
|		--pidfile /var/run/$NAME.pid
|	echo "end log of DNS traffic on $PPP_IFACE" >> /var/log/dns-tcpdump
|	;;
|esac

Since tcpdump doesn't create a pid file and start-stop-daemon treats
the file it gets passed with --pidfile as a strict read-only file, this
doesn't work since nothing actually creates the pid file. I believe that
start-stop-daemon should have an option like --create-pidfile where it
writes the pid of the newly started process to. This could be accomplished
quite easily in the source while creating the pidfile in the shell script
needs quite some effort.

Greetings
Marc


-- System Information
Debian Release: 2.1
Kernel Version: Linux torres 2.0.36 #5 Sun Apr 4 15:47:37 CEST 1999 i586 unknown

Versions of the packages dpkg depends on:
ii  libc6           2.0.7.19981211 GNU C Library: shared libraries
ii  libncurses4     4.2-3          Shared libraries for terminal handling
ii  libstdc++2.9    2.91.60-5      The GNU stdc++ library (egcs version)


Reply to: