Forum: Cfengine Help
Subject: Sending in Bug Reports
Author: nima
Link to topic: https://cfengine.com/forum/read.php?3,18159,18159#msg-18159

Hi,

As I've been hitting quite a number of crashes in cf3, I've written a little 
script to aid in generating bug reports.

I want to know what other information people would like, and add these into the 
script.  Note it's not elegant, just a proof-of-concept for now, and it'll need 
to be fudged a little to accomodate for red-hat systems.


#!/bin/bash
rm -f /tmp/cf-agent.*

function check_via_strace() {
    exec 1>/tmp/cf-agent.strace.shell.stdout
    exec 2>/tmp/cf-agent.strace.shell.stderr

    strace -o /tmp/cf-agent.strace.stderr\
        cf-agent -K\
        >/tmp/cf-agent.strace.stdout
}

function check_via_gdb() {
    exec 1>/tmp/cf-agent.gdb.shell.stdout
    exec 2>/tmp/cf-agent.gdb.shell.stderr
    gdb cf-agent\
        -ex "run -K"\
        -ex "backtrace"\
        -ex "cont"\
        -ex "quit"\
            >/tmp/cf-agent.gdb.stdout\
            2>/tmp/cf-agent.gdb.stderr
}

( check_via_strace )
( check_via_gdb )

clear

REPORT=/tmp/ceg-fault-engine.bug-report
echo > ${REPORT}
for i in /tmp/cf-agent.*; do
    if [ -s $i ]; then
        echo "Wrote $(basename $i)"
        echo "***** $(basename $i) *****" >> ${REPORT}
        cat $i >> ${REPORT}
        printf "\n\n\n\n" >> ${REPORT}
    else
        echo "Blank $(basename $i)"
    fi
done

echo "System Information:"
echo "uname -r        : $(uname -r)" >> ${REPORT}
echo "debian_version  : $(cat /etc/debian_version)" >> ${REPORT}
echo "cfengine3       : $(dpkg -l cfengine3|awk '$1 ~ /ii/ { print $3 }')" >> 
${REPORT}

echo "See the bug report here: ${REPORT}"


_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to