dovecot-sysreport \- Dovecot\(aqs system report utility
.\"------------------------------------------------------------------------
.SH SYNOPSIS
-.BR dovecot-sysreport " [" \-h|\-\-help "] [" \-c|\-\-core
-.IR binary " " core "]
+.BR dovecot-sysreport " [" \-h|\-\-help "] [" \-c|\-\-core " ["\c
+.IR binary "] " core " [...]]"
.BR "[\-d|\-\-destination
.IR dest "]
.BR "[\-k|\-\-keeptemp]
Sets the root file of the dovecot's configuration. If not set, it will be
assumed to be in the default configuration path.
.TP
-.BI \-o|\-\-core\ "binary\ core"
-Includes a core file along with its dependencies extracted from the
+.BI \-o|\-\-core\ [ binary "] " core " [...]]"
+Includes core files along with their dependencies extracted from the
specified binary file.
.TP
.BI \-d|\-\-destination\ dest
conf_flag=""
binary=""
core=""
-core_files=""
+copy_files=""
keep_temp=0
PARAMS=""
fi
if [[ "$#" -lt 2 ]] ; then
- echo "Usage: $0 $1 [<binary>] <core>"
+ echo "Usage: $0 $1 [<binary>] <core> [...]"
exit 1
fi
- # see if binary parameter is specified
- binary=$2
- if ! [ -r "$binary" ]; then
- echo "$binary not readable"
- exit 1
- fi
- binary_info=$(file "$binary")
- if echo "$binary_info" | grep "core file.*execfn: '" >/dev/null; then
- # no binary specified - detect it
- binary=$(echo "$binary_info" | sed "s;^.*execfn: '\([^\']\+\)'.*$;\1;")
+ while [[ "$#" -ge 2 ]]; do
+ # see if binary parameter is specified
+ binary=$2
if ! [ -r "$binary" ]; then
- echo "Detected binary path '$binary' from core file, but it is not readable"
+ echo "$binary not readable"
exit 1
fi
- echo "Core file was detected to be generated by $binary"
- else
- shift
- fi
+ binary_info=$(file "$binary")
+ if echo "$binary_info" | grep "core file.*execfn: '" >/dev/null; then
+ # no binary specified - detect it
+ binary=$(echo "$binary_info" | sed "s;^.*execfn: '\([^\']\+\)'.*$;\1;")
+ if ! [ -r "$binary" ]; then
+ echo "Detected binary path '$binary' from core file, but it is not readable"
+ exit 1
+ fi
+ echo "Core file was detected to be generated by $binary"
+ else
+ shift
+ fi
- core=$2
- shift
- if ! [ -s "$core" ]; then
- echo "$core not found or it is empty"
- exit 1
- fi
+ core=$2
+ shift
+ if ! [ -s "$core" ]; then
+ echo "$core not found or it is empty"
+ exit 1
+ fi
- echo "gathering core file dependencies..."
- core_files=$((echo "info shared"; sleep 1) | $gdb $binary $core | grep '^0x.*/' | sed 's,^[^/]*,,')
- cp $core $SRTEMP
+ echo "gathering core file dependencies..."
+ core_files=$((echo "info shared"; sleep 1) | $gdb $binary $core | grep '^0x.*/' | sed 's,^[^/]*,,')
+ copy_files="$copy_files $binary $core_files"
+ cp $core $SRTEMP
+ done
shift
;;
-h|--help)
- echo -e "dovecot-sysreport \t[-h|--help] [-c|--core [binary] core] [-d|--destination dest]
+ echo -e "dovecot-sysreport \t[-h|--help] [-c|--core [binary] core [...]] [-d|--destination dest]
\t\t\t[-k|--keeptemp] -- utility to gather information from the current
\t\t\tsystem to be reported for dovecot bug fixes."
echo ""
cd $SRTEMP
echo "Creating archive ..."
tar -czf `if [[ "$dest" = /* ]]; then echo $dest; else echo $cf/$dest; fi` --dereference \
- $binary $core_files *
+ $copy_files *
function cleanup {
if [ $keep_temp = 0 ]; then