DansGuardian Documentation Wiki

You are here: Main Index » capturing_problems


|

Wiki Information

Differences

This shows you the differences between the selected revision and the current version of the page.

capturing_problems 2009/01/05 15:28 capturing_problems 2009/01/06 15:37 current
Line 39: Line 39:
PROGNAME=`basename $0` PROGNAME=`basename $0`
-VERSION=5+VERSION=6
if [[ ( -d /usr/local/var/log/dansguardian ) && ( ! -h /usr/local/var/log/dansguardian ) ]]; then RECORDFILE=${RECORDFILE:-/usr/local/var/log/danshung}; fi if [[ ( -d /usr/local/var/log/dansguardian ) && ( ! -h /usr/local/var/log/dansguardian ) ]]; then RECORDFILE=${RECORDFILE:-/usr/local/var/log/danshung}; fi
if [[ ( -d /var/log/dansguardian ) && ( ! -h /var/log/dansguardian ) ]]; then RECORDFILE=${RECORDFILE:-/var/log/danshung}; fi if [[ ( -d /var/log/dansguardian ) && ( ! -h /var/log/dansguardian ) ]]; then RECORDFILE=${RECORDFILE:-/var/log/danshung}; fi
RECORDFILE=${RECORDFILE:-/var/log/danshung} RECORDFILE=${RECORDFILE:-/var/log/danshung}
if [[ "$RECORDFILE" != /* ]]; then RECORDFILE=`pwd`/$RECORDFILE; fi if [[ "$RECORDFILE" != /* ]]; then RECORDFILE=`pwd`/$RECORDFILE; fi
-USERLOG=(`logger -p user.err "$PROGNAME v$VERSION searching for user log" ; sleep 1 ; sleep 1 ; find /var/log -maxdepth 1 -type f -mmin 1`) 
-if [[ -z "$USERLOG" ]]; then USERLOG=/dev/null; fi 
-KERNLOG=(`logger -p kern.err "$PROGNAME v$VERSION searching for user log" ; sleep 1 ; sleep 1 ; find /var/log -maxdepth 1 -type f -mmin 1`) 
-if [[ -z "$KERNLOG" ]]; then KERNLOG=/dev/null; fi 
- 
# disallow interruption by user (^C, kill, etc.) # disallow interruption by user (^C, kill, etc.)
Line 57: Line 52:
-echo "** Recording OS system state in $RECORDFILE, as DansGuardian appears to be hung **"+echo "
 +echo "Please type a short description of the current state of the system,
 +echo " (DansGuardian is unresponsive so the web is inaccessible," 
 +echo " DansGuardian won't start, DansGuardian just crashed, DansGuardian" 
 +echo " is up but it doesn't work right, etc.), then press ENTER" 
 +read -p "Description? > " CURSTATE
echo "" echo ""
 +echo "** Recording DansGuardian/Squid/OS system state in $RECORDFILE **"
 +echo ""
-MESSAGE="===== `date '+%T %Z %D'` - $PROGNAME v$VERSION: beginning"+ 
 +MESSAGE="%%%%% `date '+%T %Z %D'` - $PROGNAME v$VERSION: beginning report because: $CURSTATE"
echo $MESSAGE echo $MESSAGE
echo $MESSAGE >> $RECORDFILE echo $MESSAGE >> $RECORDFILE
 +
 +USERLOG=(`logger -p user.err "$PROGNAME v$VERSION searching for user log" ; sleep 1 ; sleep 1 ; find /var/log -maxdepth 1 -type f -mmin 1`)
 +if [[ -z "$USERLOG" ]]; then USERLOG=/dev/null; fi
 +KERNLOG=(`logger -p kern.err "$PROGNAME v$VERSION searching for user log" ; sleep 1 ; sleep 1 ; find /var/log -maxdepth 1 -type f -mmin 1`)
 +if [[ -z "$KERNLOG" ]]; then KERNLOG=/dev/null; fi
 +if [[ ( -d /usr/local/etc/dansguardian ) && ( ! -h /usr/local/etc/dansguardian ) ]]; then
 + DGCONFIGDIR=${DGCONFIGDIR:-/usr/local/etc/dansguardian}
 +elif [[ ( -d /etc/dansguardian ) && ( ! -h /etc/dansguardian ) ]]; then
 + DGCONFIGDIR=${DGCONFIGDIR:-/etc/dansguardian}
 +else
 + DGCONFIGDIR=${DGCONFIGDIR:-/}
 +fi
 +if [[ -d /etc/squid ]]; then
 + SQUIDCONFIGDIR=${SQUIDCONFIGDIR:-/etc/squid}
 +else
 + SQUIDCONFIGDIR=${SQUIDCONFIGDIR:-/}
 +fi
 +
MESSAGE="===== `date '+%T %Z %D'` - $PROGNAME v$VERSION: next show who am i w/ id" MESSAGE="===== `date '+%T %Z %D'` - $PROGNAME v$VERSION: next show who am i w/ id"
Line 100: Line 121:
dmesg >> $RECORDFILE dmesg >> $RECORDFILE
-MESSAGE="===== `date '+%T %Z %D'` - $PROGNAME v$VERSION: dmesg done, next USERLOG ($USERLOG)"+MESSAGE="===== `date '+%T %Z %D'` - $PROGNAME v$VERSION: dmesg done, next the dansguardian.conf in $DGCONFIGDIR" 
 +echo $MESSAGE 
 +echo $MESSAGE >> $RECORDFILE 
 +cat $DGCONFIGDIR/dansguardian.conf >> $RECORDFILE 2>&1 
 + 
 +MESSAGE="===== `date '+%T %Z %D'` - $PROGNAME v$VERSION: dansguardian.conf done, next the dansguardianf1.conf in $DGCONFIGDIR"
echo $MESSAGE echo $MESSAGE
echo $MESSAGE >> $RECORDFILE echo $MESSAGE >> $RECORDFILE
-tail -200 $USERLOG >> $RECORDFILE+cat $DGCONFIGDIR/dansguardianf1.conf >> $RECORDFILE 2>&1
-MESSAGE="===== `date '+%T %Z %D'` - $PROGNAME v$VERSION: USERLOG done, next KERNLOG ($KERNLOG)"+MESSAGE="===== `date '+%T %Z %D'` - $PROGNAME v$VERSION: dansguardianf1.conf, next the squid.conf in $SQUIDCONFIGDIR"
echo $MESSAGE echo $MESSAGE
echo $MESSAGE >> $RECORDFILE echo $MESSAGE >> $RECORDFILE
-tail -200 $KERNLOG >> $RECORDFILE+cat $SQUIDCONFIGDIR/squid.conf >> $RECORDFILE 2>&1
-MESSAGE="===== `date '+%T %Z %D'` - $PROGNAME v$VERSION: KERNLOG done, next which dansguardian is on PATH"+MESSAGE="===== `date '+%T %Z %D'` - $PROGNAME v$VERSION: squid.conf done, next which dansguardian is on PATH"
echo $MESSAGE echo $MESSAGE
echo $MESSAGE >> $RECORDFILE echo $MESSAGE >> $RECORDFILE
Line 166: Line 192:
echo $MESSAGE >> $RECORDFILE echo $MESSAGE >> $RECORDFILE
-echo "** OS SYSTEM STATE CAPTURED," +echo "** DansGuardian/Squid/OS SYSTEM STATE CAPTURED," 
-echo "  SEND/POST CONTENTS OF FILE  $RECORDFILE  FOR AID **"+echo "  SEND/POST(in body) CONTENTS OF FILE  $RECORDFILE  FOR AID **
 +echo "  (But don't ATTACH when posting to DansGuardian mailing list;" 
 +echo "    the list will throw away attachments and nobody will ever see them.)"
</code> </code>