Bug#659975: Any progress in this matter?

2012-03-05 Thread Thomas M Steenholdt
If you need anything, please let me know - This bug kinda haunts me a
little bit, and I'd really like to have it fixed.

Thanks

/Thomas



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



Bug#659975: Revert initscript stop function to use SIGINT

2012-02-15 Thread Thomas M Steenholdt
Package: pmacct
Version: 0.12.5-4

In the current initscripts, the stop function has been changed to use
SIGTERM instead of SIGINT.

SIGTERM kicks the processes over in a way, that may cause sampled data
not yet pushed to backend storage to be lost. For this reason, please
change them back to SIGINT.

The best way to implement this, would probably be to let the SIGINT'ed
processes finish before returning from the stop function. This makes
sure that we don't have a lot of leftover processes in case overloaded
databases and such.

(The changelog for 0.12.5-4 suggest that the change back to SIGINT is
included, but that does not seem to be the case - This bug serves as a
reminder for this)

/Thomas





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



Bug#659975: Something like this perhaps?

2012-02-15 Thread Thomas M Steenholdt
Perhaps something like this could be used instead? This has not been
thoroughly tested, so consider it a blueprint :-)

Idea: Initially, signal only the parent process with the INT signal to
let it gracefully end all its child-processes and itself. If the parent
process does not terminate within some threshold of time, something is
hanging and we basically perform a killall -TERM on the remaining processes.

pkill -INT -P 1 `basename $DAEMON`
TIMEOUT=30
while pgrep -P 1 `basename $DAEMON` /dev/null  test $TIMEOUT
-gt 0; do
TIMEOUT=$((TIMEOUT-1))
sleep 1;
done
if test $TIMEOUT -eq 0; then
pkill -TERM `basename $DAEMON`
fi

Food for thought...



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



Bug#659710: sfacctd, nfacctd, uacctd daemons missing initscripts, default-files and sample configs

2012-02-13 Thread Thomas M Steenholdt
Package: pmacct
Version: 0.12.5-1

Even though the pmacct packages provides the sfacctd, nfacctd daemons in 
addition
to the pmacctd daemon, they are missing corresponding initscripts, default-files
and sample configs.

I've attached proposed files for inclusion - the sfacct ones, I've tested, the
nfacct, pmacct ones, I've not. That said, the changes compared the currently
provided files for pmacct, is pretty much a matter of search/replace. The only
other changes I've made are:

- stop function of the initscripts now uses SIGTERM instead of SIGINT, as SIGINT
  does not seem to be adequate anymore.
- the sample config files have had daemon-name_ prepended to the recovery_log
  filenames.

I've tested the proposed changes on the sfacct side of things, on Ubuntu Lucid.

Please let me know if you'd rather have a diff or something.

/Thomas

# Defaults for nfacct initscript
# sourced by /etc/init.d/nfacct
# installed at /etc/default/sfacct by the maintainer scripts

#
# This is a POSIX shell fragment
#

# Location of the configuration file
NFACCTD_CONF=/etc/pmacct/nfacctd.conf

# List of interfaces to start accounting on.
# See /usr/share/doc/pmacct/README.Debian for details.
INTERFACES=

# Additional options that are passed to nfacctd
DAEMON_OPTS=
#!/bin/sh

### BEGIN INIT INFO
# Provides: nfacct
# Required-start: $network $syslog
# Required-stop: $network $syslog
# Default-start: 2 3 4 5
# Default-stop: 0 1 6
# Short-Description: netflow accounting daemon
### END INIT INFO

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/nfacctd
NAME=nfacctd
DESC=netflow accounting daemon
CONFDIR=/etc/pmacct

test -x $DAEMON || exit 0

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

stop () {
#start-stop-daemon --stop --oknodo --quiet \
#   --pidfile /var/run/$NAME.pid \
#   --exec $DAEMON
killall -TERM nfacctd
}

start () {
#start-stop-daemon --start --oknodo --quiet \
#   --pidfile /var/run/$NAME.pid \
#   --exec $DAEMON -- -f $PMACCTD_CONF $DAEMON_OPTS
if [ -n $INTERFACES ]; then
for i in $INTERFACES; do
ip link set $i up
$DAEMON -f $CONFDIR/nfacctd.$i.conf $DAEMON_OPTS
done
else
$DAEMON -f $CONFDIR/nfacctd.conf $DAEMON_OPTS
fi
}

case $1 in
  start)
echo -n Starting $DESC: 
start
echo $NAME.
;;
  stop)
echo -n Stopping $DESC: 
stop
echo $NAME.
;;
  #reload)
#
#   If the daemon can reload its config files on the fly
#   for example by sending it SIGHUP, do it here.
#
#   If the daemon responds to changes in its config file
#   directly anyway, make this a do-nothing entry.
#
# echo Reloading $DESC configuration files.
# start-stop-daemon --stop --signal 1 --quiet --pidfile \
#   /var/run/$NAME.pid --exec $DAEMON
  #;;
  restart|force-reload)
#
#   If the reload option is implemented, move the force-reload
#   option to the reload entry above. If not, force-reload is
#   just the same as restart.
#
echo -n Restarting $DESC: 
stop
sleep 1
start
echo $NAME.
;;
  *)
N=/etc/init.d/$NAME
# echo Usage: $N {start|stop|restart|reload|force-reload} 2
echo Usage: $N {start|stop|restart|force-reload} 2
exit 1
;;
esac

exit 0
! nfacctd configuration
!
!
!
daemonize: true
pidfile: /var/run/nfacctd.pid
syslog: daemon
!
! interested in in and outbound traffic
aggregate: src_host,dst_host
! on this network
pcap_filter: net 127.0.0.0/8
! on this interface
interface: lo
!
! storage methods
!plugins: pgsql
!sql_host: localhost
!sql_passwd:
! refresh the db every minute
!sql_refresh_time: 60
! reduce the size of the insert/update clause
!sql_optimize_clauses: true
! accumulate values in each row for up to an hour
!sql_history: 1h
! create new rows on the minute, hour, day boundaries
!sql_history_roundoff: mhd
! in case of emergency, log to this file
!sql_recovery_logfile: /var/lib/pmacct/nfacctd_recovery_log
#!/bin/sh

### BEGIN INIT INFO
# Provides: pmacct
# Required-start: $network $syslog
# Required-stop: $network $syslog
# Default-start: 2 3 4 5
# Default-stop: 0 1 6
# Short-Description: promiscuous mode accounting daemon
### END INIT INFO

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/pmacctd
NAME=pmacctd
DESC=promiscuous mode accounting daemon
CONFDIR=/etc/pmacct

test -x $DAEMON || exit 0

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

stop () {
#start-stop-daemon --stop --oknodo --quiet \
#   --pidfile /var/run/$NAME.pid \
#   --exec $DAEMON
killall -TERM pmacctd
}

start () {
#start-stop-daemon --start --oknodo --quiet \
#  

Bug#659711: please configure with --enable-64bit and --enable-threads flags

2012-02-13 Thread Thomas M Steenholdt
Package: pmacct
Version: 0.12.5-1

At least, sfacctd (mysql plugin) seems to have problems correctly
reporting the bytes-count in flows. This results in one-hour byte-counts
in excess of 100TB on relatively inactive 4mbit links).

I've rebuild using the configure-flags: --enable-64bit --enable-threads

After that, everything appears to be working fine. This was tested on
Ubuntu Lucid, amd64, fwiw.

Please let me know if you'd rather have a diff of the rules script or
something.

/Thomas





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



Bug#659710: SIGINT is probably better anyway...

2012-02-13 Thread Thomas M Steenholdt
In the proposed initscripts, I've changed the stop function to use
SIGTERM instead of SIGINT. The reason for this is, that I was having
some database problems, that left the sfacctd processes running
(working), even after sfacct was sent a signal to stop. This could cause
old processes to still run, on restart for instance, and I initially saw
this a problem with the signal.

SIGTERM kicks the processes over in a way, that may not always be good -
I'm pretty sure, data is lost when doing this, so please change them
back to SIGINT.

The best thing would probably be to wait for the processes to finish
their jobs and terminate, before leaving the stop function in the
initscripts.




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