Blame src/daemon/abrt_event.conf

Packit 8ea169
# This configuration file specifies which programs should be run
Packit 8ea169
# when the specified event occurs in problem directory lifetime.
Packit 8ea169
#
Packit 8ea169
# It consists of directives and rules.
Packit 8ea169
#
Packit 8ea169
# Directives start with a reserved word. Currently, there is only one
Packit 8ea169
# directive, "include". Its format is "include FILE".
Packit 8ea169
# It causes files which match FILE to be read and
Packit 8ea169
# parsed as if they are inserted textually where this directive
Packit 8ea169
# occurs. FILE can use shell pattern metacharacters (*,?,etc) to
Packit 8ea169
# specify multiple files. Relative paths are interpreted relative
Packit 8ea169
# to current file.
Packit 8ea169
#
Packit 8ea169
# Rule starts with a line with non-space leading character.
Packit 8ea169
# All subsequent lines which start with space or tab form one rule.
Packit 8ea169
#
Packit 8ea169
# EVENT=post-create
Packit 8ea169
#
Packit 8ea169
#         cp /etc/example.conf .
Packit 8ea169
#         uptime > uptime
Packit 8ea169
#         echo $HOSTNAME `uname -r`
Packit 8ea169
#
Packit 8ea169
# This example event will copy `/etc/example.conf` to newly created
Packit 8ea169
# problem directory, store current uptime in `uptime` file
Packit 8ea169
# and prints current hostname and uname to logs.
Packit 8ea169
#
Packit 8ea169
# Rules may be commented out with #. One # is sufficient to comment out
Packit 8ea169
# even a multi-line rule (no need to comment out every line).
Packit 8ea169
#
Packit 8ea169
# Rules specify which programs to run on the problem directory.
Packit 8ea169
# Each rule may have conditions to be checked before the program is run.
Packit 8ea169
#
Packit 8ea169
# Conditions have form VAR[!]=VAL or VAL~=REGEX, where VAR is either
Packit 8ea169
# word "EVENT" or a name of problem directory element to be checked
Packit 8ea169
# (for example, "executable", "package", hostname" etc).
Packit 8ea169
#
Packit 8ea169
# If all conditions match, the remaining part of the rule
Packit 8ea169
# (the "program" part) is run in the shell.
Packit 8ea169
# All shell language constructs are valid.
Packit 8ea169
# All stdout and stderr output is captured and passed to abrt
Packit 8ea169
# and possibly to abrt's frontends and shown to the user.
Packit 8ea169
#
Packit 8ea169
# If the program terminates with nonzero exit code,
Packit 8ea169
# the event processing is considered unsuccessful and is stopped.
Packit 8ea169
# Last captured output line, if any, is considered to be
Packit 8ea169
# the error message indicating the reason of the failure,
Packit 8ea169
# and may be used by abrt as such.
Packit 8ea169
#
Packit 8ea169
# If the program terminates successfully, next rule is read
Packit 8ea169
# and processed. This process is repeated until the end of this file.
Packit 8ea169
Packit 8ea169
Packit 8ea169
# Determine in which package/component the crash happened (if not yet done):
Packit 8ea169
EVENT=post-create container_cmdline= remote!=1 component=
Packit 8ea169
        abrt-action-save-package-data
Packit 8ea169
Packit 8ea169
# Store information about the container:
Packit 8ea169
EVENT=post-create container_cmdline!= remote!=1
Packit 8ea169
      /usr/libexec/abrt-action-save-container-data || :
Packit 8ea169
Packit 8ea169
Packit 8ea169
# Example: if you want all users (not just root) to be able to see some problems:
Packit 8ea169
#EVENT=post-create
Packit 8ea169
        rm uid; chmod a+rX .
Packit 8ea169
Packit 8ea169
EVENT=post-create remote!=1
Packit 8ea169
        # uid file is missing for problems visible to all users
Packit 8ea169
        # (oops scanner is often set up to not create it).
Packit 8ea169
        # Record username only if uid element is present:
Packit 8ea169
        if [ -f uid ]; then getent passwd "`cat uid`" | cut -d: -f1 >username; fi
Packit 8ea169
        # Save cpuinfo because crashes in some components are
Packit 8ea169
        # related to HW acceleration. The file must be captured for all crashes
Packit 8ea169
        # because of the library vs. executable problem.
Packit 8ea169
        if command -v lscpu >/dev/null 2>&1; then
Packit 8ea169
            # use lscpu if installed
Packit 8ea169
            lscpu > $DUMP_DIR/cpuinfo
Packit 8ea169
        else
Packit 8ea169
            cp /proc/cpuinfo $DUMP_DIR/cpuinfo
Packit 8ea169
        fi
Packit 8ea169
Packit 8ea169
# Record runlevel (if not yet done) and don't return non-0 if it fails:
Packit 8ea169
EVENT=post-create runlevel= remote!=1
Packit 8ea169
        runlevel >runlevel 2>&1
Packit 8ea169
        exit 0
Packit 8ea169
Packit 8ea169
# A dummy EVENT=post-create for uploaded problems.
Packit 8ea169
# abrtd would delete uploaded problems without this EVENT.
Packit 8ea169
EVENT=post-create remote=1
Packit 8ea169
        echo "Processing uploaded problem : $DUMP_DIR"
Packit 8ea169
Packit 8ea169
# Example:
Packit 8ea169
# if you want to upload data immediately at the moment of a crash to
Packit 8ea169
# a remote directory:
Packit 8ea169
# (this example shows how to upload the crash data on
Packit 8ea169
#  a ABRT centralized crash collection client; man abrt-upload-watch)
Packit 8ea169
#
Packit 8ea169
# CAUTION:
Packit 8ea169
#   The event 'notify' is used because it will ensure that the uploaded problem
Packit 8ea169
#   data will contain results of all post-create events.
Packit 8ea169
#
Packit 8ea169
#   The event 'notify' might not get executed if any of the post-create events
Packit 8ea169
#   decide that the problem should be ignored by ABRT (e.g. unpackaged program,
Packit 8ea169
#   unsigned package, ...).
Packit 8ea169
#
Packit 8ea169
#   For duplicate problems, abrtd executes the event 'notify-dup'. If you want
Packit 8ea169
#   to upload also duplicate occurrences of a single problem, copy the lines
Packit 8ea169
#   below and change "EVENT=notify" to "EVENT=notify-dup".
Packit 8ea169
#
Packit 8ea169
#EVENT=notify
Packit 8ea169
        reporter-upload -u scp://user:password@server.name/var/spool/abrt-upload/ || :
Packit 8ea169
Packit 8ea169
# Example:
Packit 8ea169
# if you want to upload data immediately at the moment of a crash to
Packit 8ea169
# a remote file
Packit 8ea169
#
Packit 8ea169
# CAUTION:
Packit 8ea169
#   The event 'notify' is used because it will ensure that the uploaded problem
Packit 8ea169
#   data will contain results for all post-create events.
Packit 8ea169
#
Packit 8ea169
#   The event 'notify' might not get executed if any of the post-create events
Packit 8ea169
#   decide that the problem should be ignored by ABRT (e.g. unpackaged program,
Packit 8ea169
#   unsigned package, ...).
Packit 8ea169
#
Packit 8ea169
#   For duplicate problems, abrtd executes the event 'notify-dup'. If you want
Packit 8ea169
#   to upload also duplicate occurrences of a single problem, copy the lines
Packit 8ea169
#   below and change "EVENT=notify" to "EVENT=notify-dup".
Packit 8ea169
#
Packit 8ea169
#EVENT=notify
Packit 8ea169
        reporter-upload -u scp://user:password@server.name/tmp/crash.tar.gz || :
Packit 8ea169
Packit 8ea169
Packit 8ea169
#open-gui event is used by abrt-gui's "Edit"->"Open problem data"
Packit 8ea169
Packit 8ea169
EVENT=open-gui
Packit 8ea169
        report-gtk -x -- "$DUMP_DIR"
Packit 8ea169
Packit 8ea169
# Notify a new crash
Packit 8ea169
EVENT=notify
Packit 8ea169
        abrt-action-notify -d $DUMP_DIR
Packit 8ea169
        true # ignore failures because we want to run all 'notify' events
Packit 8ea169
Packit 8ea169
# Notify a new occurrence of a single crash
Packit 8ea169
EVENT=notify-dup
Packit 8ea169
        abrt-action-notify -d $DUMP_DIR
Packit 8ea169
        true # ignore failures because we want to run all 'notify' events