On 23 Dec 2003, at 18:48, Henrik Nordstrom <[EMAIL PROTECTED]> wrote:

> On 23 Dec 2003, Gonzalo Arana wrote:
>
> > Besides ulimit -HSc unlimited, enough disk space and directory
> > permissions for user nobody in coredump_dir, am I missing something?
>
> Don't start Squid as root.

 if effective uid does not match real uid, core is not produced.

> Don't use pthreads.

 depending on OS.. on solaris this isn't such a problem for eg.

> The Squid FAQ entry on how to report bugs also has useful information on
> the subject, including how to get useful information even in situations
> where core dumps are not at all possible.

 As we run squid on port 80, we are forced to start it as root, thus we
 have same issue. To get backtraces and core, I've modded DebugCache
 script abit, perhaps this can be of use to anyone. It allows you to run
 squid from its install directory with run scripts of your likening, and
 have separate script attaching to the running process and get automated
 traces when crashes are trapped.

#!/bin/sh
# Modified RunCache script to get automated stacktraces on failures from running Squid
#

# Usage: $0 squid-binary pid-file

squid=$1 ; shift
pidfile=$1 ; shift

cat <<EOF >stacktrace.gdb
set pagination off
handle all pass nostop noprint
handle SIGSEGV stop print
handle SIGBUS stop print
handle SIGABRT stop print
break fatal
cont
gcore core
bt full
c
bt
c
bt
c
bt
c
bt
c
bt
quit
EOF

while : ; do
   if [ -s $pidfile ]; then
        pid=`cat $pidfile`
        echo "Attaching to Running $squid $pid"
        echo "Startup: `date`"
        gdb --readnow --batch -x stacktrace.gdb $squid $pid
        echo "Stop: `date`"
        echo " ------------------- "
   else
       echo "No running squid found"
   fi
        sleep 10
done


------------------------------------
 Andres Kroonmaa <[EMAIL PROTECTED]>
 CTO, Microlink Data AS
 Tel: 6501 731, Fax: 6501 725
 P�rnu mnt. 158, Tallinn
 11317 Estonia

Reply via email to