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 |
|
34 |
- |
63 |
EVENT=notify package!=
|
|
|
64 |
abrt-action-notify -d $DUMP_DIR
|
4 |
- |
65 |
|
|
|
66 |
|
34 |
- |
67 |
EVENT=notify-dup package!= uid!=
|
|
|
68 |
abrt-action-notify -d $DUMP_DIR
|
4 |
- |
69 |
|
|
|
70 |
|
|
|
71 |
# Example: if you want to save sosreport immediately at the moment of a crash:
|
|
|
72 |
# (alternatively, you can add similar command to EVENT=analyze_foo's,
|
|
|
73 |
# if you would rather perform this collection later):
|
|
|
74 |
EVENT=post-create
|
|
|
75 |
nice sosreport --tmp-dir "$DUMP_DIR" --batch \
|
34 |
- |
76 |
--only=anaconda --only=boot --only=devicemapper \
|
4 |
- |
77 |
--only=filesys --only=hardware --only=kernel --only=libraries \
|
|
|
78 |
--only=memory --only=networking --only=nfsserver --only=pam \
|
|
|
79 |
--only=process --only=rpm -k rpm.rpmva=off --only=ssh \
|
|
|
80 |
--only=startup --only=yum --only=general --only=x11 \
|
|
|
81 |
>sosreport.log 2>&1 \
|
|
|
82 |
&& {
|
|
|
83 |
rm sosreport.log
|
|
|
84 |
rm sosreport*.md5
|
|
|
85 |
mv sosreport*.tar.bz2 sosreport.tar.bz2
|
|
|
86 |
mv sosreport*.tar.xz sosreport.tar.xz
|
|
|
87 |
exit 0
|
|
|
88 |
} 2>/dev/null
|
|
|
89 |
# Error in sosreport run. Let user see the problem.
|
|
|
90 |
echo "sosreport run failed with exit code $?, log follows:"
|
|
|
91 |
# sosreport prints many useless empty lines, nuke them:
|
|
|
92 |
# it looks awful in syslog otherwise.
|
|
|
93 |
cat sosreport.log | sed 's/ *$//' | grep -v '^$'
|
|
|
94 |
rm sosreport.log
|
|
|
95 |
exit 1
|
|
|
96 |
|
34 |
- |
97 |
# Example: if you want to include *machineid* in dump directories:
|
|
|
98 |
EVENT=post-create
|
|
|
99 |
/usr/libexec/abrt-action-generate-machine-id -o $DUMP_DIR/machineid >>event_log 2>&1 || :
|
4 |
- |
100 |
|
9 |
- |
101 |
# Example:
|
|
|
102 |
# if you want to upload data immediately at the moment of a crash to
|
|
|
103 |
# a remote directory:
|
|
|
104 |
# (this example shows how to upload the crash data on
|
|
|
105 |
# a ABRT centralized crash collection client; man abrt-upload-watch)
|
4 |
- |
106 |
#EVENT=post-create
|
9 |
- |
107 |
reporter-upload -u scp://user:password@server.name/var/spool/abrt-upload/ || :
|
4 |
- |
108 |
|
9 |
- |
109 |
# Example:
|
|
|
110 |
# if you want to upload data immediately at the moment of a crash to
|
|
|
111 |
# a remote file
|
|
|
112 |
#EVENT=post-create
|
|
|
113 |
reporter-upload -u scp://user:password@server.name/tmp/crash.tar.gz || :
|