[dirty hack] restart tcpdump every hour (via univnautes-cleanup.sh)

dirty hack against a memory leak in tcpdump ...
This commit is contained in:
Thomas NOËL 2013-03-21 15:58:55 +01:00
parent a5bc4a5694
commit 1b69946e0a
1 changed files with 13 additions and 2 deletions

View File

@ -1,7 +1,7 @@
#!/bin/sh
# clean out old data from the database (sessions)
# Cf https://docs.djangoproject.com/en/dev/ref/django-admin/#cleanup
# clean out old data from the database (sessions)
# Cf https://docs.djangoproject.com/en/dev/ref/django-admin/#cleanup
cd /usr/local/univnautes
. bin/activate
@ -12,4 +12,15 @@ cd ..
cd pfidp
python ./manage.py cleanup
# restart bad tcpdump (memory leak...?)
/bin/pgrep -af 'tcpdump -s 256 -v -S -l -n -e -ttt -i pflog0' > /tmp/tcpdump.pid
if [ $? -eq 0 ]
then
/sbin/conscontrol mute on 2>&1 > /dev/null
kill `cat /tmp/tcpdump.pid` || exit 1
sleep 1
/usr/sbin/tcpdump -s 256 -v -S -l -n -e -ttt -i pflog0 2>&1 | logger -t pf -p local0.info 2> /dev/null &
/sbin/conscontrol mute off 2>&1 > /dev/null
fi
exit 0