update .gitignore
[fai-configs.git] / hooks / savelog.LAST.source
CommitLineData
2d1f8014 1#! /bin/bash
2
3# parse all log files for error messages
4# print errors and warnings found to error.log
5# WARNING: This will only work with english error messages!
6
7errfile=$LOGDIR/error.log
8
9# Define grep patterns. Do not start or end with an empty line!
10globalerrorpatterns="error
11fail
12warn
13bad
14no space
15syntax
16Couldn't stat
17Cannot access
18is bigger than the limit
19did not exist
20non existent
21not found
22couldn't
23can't
24E: Sorry, broken packages
25operator expected
26ambiguous redirect
27No previous regular expression
28No such
29Device or resource busy
30unknown option
31[a-z]\+\.log:E:
32No candidate version found
33segfault
34Couldn't find any package whose name or description matched
35cannot create
36The following packages have unmet dependencies"
37
38globalignorepatterns="[a-z]\+\.log:#
39Error: Driver 'pcspkr' is already registered, aborting
40: bytes packets errors dropped
41:+ error=0
42:+ trap error=
43task_error_func=
44STOP_ON_ERROR=
45courier-webadmin
46gstreamer0.10-plugins-bad
47ibwebadmin
48kernel-patch-badram
49kolab-webadmin
50kolabadmin
51gstreamer0.10-plugins-really-bad
52gsambad
53libad
54libtest-nowarnings-perl
55libtest-warn-perl
56libclass-errorhandler-perl
57zope-ploneerrorreporting
58libroxen-errormessage
59liberror-perl
60libgpg-error-dev
61libgpg-error0
62^fstab.\+errors=remount
63[RT]X packets:
64WARNING: unexpected IO-APIC
65warned about = ( )
66daemon.warn
67kern.warn
68rw,errors=
69Expect some cache
70no error
71failmsg
72RPC call returned error 101
73deverror.out
74(floppy), sector 0
75mount version older than kernel
76Can't locate module
77Warning only 896MB will be used.
78hostname: Host name lookup failure
79I can't tell the difference.
80warning, not much extra random data, consider using the -rand option
81confC._FILE
82Warning: 3 database(s) sources
83were not found, (but were created)
84removing exim
85The home dir you specified already exists.
86No Rule for /usr/lib/ispell/default.hash.
87/usr/sbin/update-fonts-.\+: warning: absolute path
88hostname: Unknown server error
89EXT2-fs warning: checktime reached
90RPC: sendmsg returned error 101
91can't print them to stdout. Define these classes
92warning: downgrading
93suppress emacs errors
94echo Error:
95Can't open dependencies file
96documents in /usr/doc are no longer supported
97if you have both a SCSI and an IDE CD-ROM
98Warning: /proc/ide/hd?/settings interface is obsolete, and will be removed soon
99Monitoring disabled
100Error: only one processor found.
101Error Recovery Strategy:
102sector 0 does not have an
103syslogin_perform_logout: logout() returned an error
104grub is not in an XFS filesystem.
105grub-install: line 374:
106grub-probe: error: Cannot open \`/boot/grub/device.map'
107is harmless
108not updating .\+ font directory data.
109register_serial(): autoconfig failed
110Fontconfig error: Cannot load default config file
111asking for cache data failed
112However, I can not read the target:
113fai-kernels/modules.dep: No such file
114Warning: The partition table looks like it was made
115task_error=0
116^info: Trying to set
117warning: /usr/lib/X11/fonts
118can't read /etc/udev/rules.d/z25_persistent-net.rules
119/cow': No such file or directory
120Dummy start-stop-daemon called
121X: bytes packets errors
122ACPI Error
123ACPI Warning
124cannot stat \`/etc/modprobe.d/\*.conf'
125cdrom: open failed."
126
127# add pattern on some conditions
128if [ -n $FAI_ALLOW_UNSIGNED ] ; then
129 globalignorepatterns="$globalignorepatterns
130WARNING: untrusted versions
131Ignoring these trust violations"
132fi
133# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
134# Here you can define your own patterns. Put one pattern in a line,
135# do not create empty lines.
136myerrorpatterns="XXXXX"
137myignorepatterns="XXXXX"
138# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
139# The main routine
140errorpatterns="$globalerrorpatterns
141$myerrorpatterns"
142ignorepatterns="$globalignorepatterns
143$myignorepatterns"
144
145cd $LOGDIR || exit 3
146if [ -s $errfile ]; then
147 echo "Errorfile already exists. Aborting."
148 exit
149fi
150
151grep -i "$errorpatterns" *.log | grep -vi "$ignorepatterns" > $errfile
152if [ "$verbose" ]; then
153 egrep -v '^software.log:' $errfile > $LOGDIR/tempfile
154 mv $LOGDIR/tempfile $errfile
155fi
156
157if [ -s $errfile ]; then
158 echo "ERRORS found in log files. See $errfile"
159else
160 echo "Congratulations! No errors found in log files."
161 export flag_reboot=1
162fi