Subversion Repositories configs

Rev

Rev 4 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
4 - 1
# This configuration file specifies which programs should be run
2
# when the specified event occurs in problem directory lifetime.
3
#
4
# It consists of directives and rules.
5
#
6
# Directives start with a reserved word. Currently, there is only one
7
# directive, "include". Its format is "include FILE".
8
# It causes files which match FILE to be read and
9
# parsed as if they are inserted textually where this directive
10
# occurs. FILE can use shell pattern metacharacters (*,?,etc) to
11
# specify multiple files. Relative paths are interpreted relative
12
# to current file.
13
#
14
# Rule starts with a line with non-space leading character.
15
# All subsequent lines which start with space or tab form one rule.
16
# Note that separating newline is *retained*. Example:
17
# EVENT=post-create   date >/tmp/dt  # semicolon is not needed here!
18
#                     echo $HOSTNAME `uname -r`
19
#
20
# Rules may be commented out with #. One # is sufficient to comment out
21
# even a multi-line rule (no need to comment out every line).
22
#
23
# Rules specify which programs to run on the problem directory.
24
# Each rule may have conditions to be checked before the program is run.
25
#
26
# Conditions have form VAR=VAL or VAL~=REGEX, where VAR is either
27
# word "EVENT" or a name of problem directory element to be checked
28
# (for example, "executable", "package", hostname" etc).
29
#
30
# If all conditions match, the remaining part of the rule
31
# (the "program" part) is run in the shell.
32
# All shell language constructs are valid.
33
# All stdout and stderr output is captured and passed to abrt
34
# and possibly to abrt's frontends and shown to the user.
35
#
36
# If the program terminates with nonzero exit code,
37
# the event processing is considered unsuccessful and is stopped.
38
# Last captured output line, if any, is considered to be
39
# the error message indicating the reason of the failure,
40
# and may be used by abrt as such.
41
#
42
# If the program terminates successfully, next rule is read
43
# and processed. This process is repeated until the end of this file.
44
 
45
 
46
# Determine in which package/component the crash happened (if not yet done):
47
EVENT=post-create component= remote!=1
48
        abrt-action-save-package-data
49
 
50
 
51
# Example: if you want all users (not just root) to be able to see some problems:
52
#EVENT=post-create
53
        rm uid; chmod a+rX .
54
 
55
 
56
# uid file is missing for problems visible to all users
57
# (oops scanner is often set up to not create it).
58
# Record username only if uid element is present:
59
EVENT=post-create
60
        if [ -f uid ]; then getent passwd "`cat uid`" | cut -d: -f1 >username; fi
61
 
62
 
63
EVENT=notify package!= uid!=
64
    if [ ! -x "/bin/dbus-send" ]; then exit 0; fi
65
    dbus-send --system --type=signal /com/redhat/abrt com.redhat.abrt.Crash \
66
    string:"`cat package`" string:"$DUMP_DIR" string:"`cat uid`"
67
 
68
EVENT=notify package!= uid=
69
    if [ ! -x "/bin/dbus-send" ]; then exit 0; fi
70
    dbus-send --system --type=signal /com/redhat/abrt com.redhat.abrt.Crash \
71
    string:"`cat package`" string:"$DUMP_DIR" >& /dev/null
72
 
73
EVENT=notify_dup package!= uid!=
74
    if [ ! -x "/bin/dbus-send" ]; then exit 0; fi
75
    dbus-send --system --type=signal /com/redhat/abrt com.redhat.abrt.Crash \
76
    string:"`cat package`" string:"$DUMP_DIR" string:"`cat uid`"
77
 
78
EVENT=notify_dup package!= uid=
79
    if [ ! -x "/bin/dbus-send" ]; then exit 0; fi
80
    dbus-send --system --type=signal /com/redhat/abrt com.redhat.abrt.Crash \
81
    string:"`cat package`" string:"$DUMP_DIR"
82
 
83
 
84
# Example: if you want to save sosreport immediately at the moment of a crash:
85
# (alternatively, you can add similar command to EVENT=analyze_foo's,
86
# if you would rather perform this collection later):
87
EVENT=post-create
88
        nice sosreport --tmp-dir "$DUMP_DIR" --batch \
89
                --only=anaconda --only=bootloader --only=devicemapper \
90
                --only=filesys --only=hardware --only=kernel --only=libraries \
91
                --only=memory --only=networking --only=nfsserver --only=pam \
92
                --only=process --only=rpm -k rpm.rpmva=off --only=ssh \
93
                --only=startup --only=yum --only=general --only=x11 \
94
                >sosreport.log 2>&1 \
95
        && {
96
                rm sosreport.log
97
                rm sosreport*.md5
98
                mv sosreport*.tar.bz2 sosreport.tar.bz2
99
                mv sosreport*.tar.xz sosreport.tar.xz
100
                exit 0
101
        } 2>/dev/null
102
        # Error in sosreport run. Let user see the problem.
103
        echo "sosreport run failed with exit code $?, log follows:"
104
        # sosreport prints many useless empty lines, nuke them:
105
        # it looks awful in syslog otherwise.
106
        cat sosreport.log | sed 's/  *$//' | grep -v '^$'
107
        rm sosreport.log
108
        exit 1
109
 
110
 
9 - 111
# Example:
112
# if you want to upload data immediately at the moment of a crash to
113
# a remote directory:
114
# (this example shows how to upload the crash data on
115
#  a ABRT centralized crash collection client; man abrt-upload-watch)
4 - 116
#EVENT=post-create
9 - 117
     reporter-upload -u scp://user:password@server.name/var/spool/abrt-upload/ || :
4 - 118
 
9 - 119
# Example:
120
# if you want to upload data immediately at the moment of a crash to
121
# a remote file
122
#EVENT=post-create
123
        reporter-upload -u scp://user:password@server.name/tmp/crash.tar.gz || :