74aa116a609d5253924218f4f34133a3d252b52d
[automated-distro-installer] / fai / config / hooks / savelog.LAST.sh
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
7 errfile=$LOGDIR/error.log
8
9 # Define grep patterns. Do not start or end with an empty line!
10 globalerrorpatterns="error
11 fail
12 warn
13 bad
14 bad
15 no space
16 syntax
17 Couldn't stat
18 Cannot access
19 conflict
20 is bigger than the limit
21 did not exist
22 non existent
23 not found
24 couldn't
25 can't
26 E: Sorry, broken packages
27 operator expected
28 ambiguous redirect
29 No previous regular expression
30 No such
31 Device or resource busy
32 unknown option
33 [a-z]\+\.log:E:
34 No candidate version found
35 segfault
36 Couldn't find any package whose name or description matched
37 cannot create
38 The following packages have unmet dependencies"
39
40 globalignorepatterns="[a-z]\+\.log:#
41 Error: Driver 'pcspkr' is already registered, aborting
42 : bytes packets errors dropped
43 :+ error=0
44 :+ trap error=
45 task_error_func=
46 STOP_ON_ERROR=
47 courier-webadmin
48 plugins-bad
49 Enabling conf localized-error-pages
50 ibwebadmin
51 kernel-patch-badram
52 kolab-webadmin
53 kolabadmin
54 gstreamer0.10-plugins-really-bad
55 liberrors.so
56 gsambad
57 libad
58 libtest-nowarnings-perl
59 libtest-warn-perl
60 libclass-errorhandler-perl
61 zope-ploneerrorreporting
62 libroxen-errormessage
63 liberror-perl
64 libgpg-error-dev
65 libgpg-error0
66 ^fstab.\+errors=remount
67 Opts: errors=remount-ro
68 [RT]X packets:
69 WARNING: unexpected IO-APIC
70 warned about = ( )
71 daemon.warn
72 kern.warn
73 rw,errors=
74 Expect some cache
75 no error
76 failmsg
77 RPC call returned error 101
78 deverror.out
79 (floppy), sector 0
80 mount version older than kernel
81 Can't locate module
82 Warning only 896MB will be used.
83 hostname: Host name lookup failure
84 I can't tell the difference.
85 warning, not much extra random data, consider using the -rand option
86 confC._FILE
87 Warning: 3 database(s) sources
88 were not found, (but were created)
89 removing exim
90 The home dir you specified already exists.
91 No Rule for /usr/lib/ispell/default.hash.
92 /usr/sbin/update-fonts-.\+: warning: absolute path
93 hostname: Unknown server error
94 EXT2-fs warning: checktime reached
95 RPC: sendmsg returned error 101
96 can't print them to stdout. Define these classes
97 warning: downgrading
98 suppress emacs errors
99 echo Error:
100 Can't open dependencies file
101 documents in /usr/doc are no longer supported
102 if you have both a SCSI and an IDE CD-ROM
103 Warning: /proc/ide/hd?/settings interface is obsolete, and will be removed soon
104 Monitoring disabled
105 Error: only one processor found.
106 Error Recovery Strategy:
107 sector 0 does not have an
108 syslogin_perform_logout: logout() returned an error
109 grub is not in an XFS filesystem.
110 grub-install: line 374:
111 grub-probe: error: Cannot open \`/boot/grub/device.map'
112 is harmless
113 not updating .\+ font directory data.
114 register_serial(): autoconfig failed
115 Fontconfig error: Cannot load default config file
116 asking for cache data failed
117 However, I can not read the target:
118 Warning: The partition table looks like it was made
119 task_error=0
120 ^info: Trying to set
121 warning: /usr/lib/X11/fonts
122 can't read /etc/udev/rules.d/z25_persistent-net.rules
123 /cow': No such file or directory
124 Dummy start-stop-daemon called
125 X: bytes packets errors
126 ACPI Error
127 ACPI Warning
128 AE_NOT_FOUND
129 conflicts with ACPI region
130 cannot stat \`/etc/modprobe.d/\*.conf'
131 cdrom: open failed.
132 libgpg-error
133 process \`kudzu' used the deprecated sysctl system call
134 PM: Resume from disk failed
135 JBD: barrier-based sync failed
136 aufs: module is from the staging directory, the quality is unknown
137 warning: linuxlogo stop runlevel arguments (none) do not match
138 insserv: warning: script .\+ missing LSB tags and overrides
139 live-premount.\+ If this fails
140 cannot read table of mounted file systems
141 error: no alternatives for
142 ERST: Error Record Serialization Table (ERST) support is initialized
143 ERST: Table is not found
144 HEST: Table not found
145 failed to stat /dev/pts
146 Failed to connect to socket /var/run/dbus/system_bus_socket
147 fail to add MMCONFIG information
148 can't initialize iptables table
149 can't initialize ip6tables table
150 Authentication warning overridden
151 update-alternatives: warning: skip creation of
152 update-rc.d: warning: start and stop actions are no longer supported"
153
154 # add pattern on some conditions
155 if [ -n $FAI_ALLOW_UNSIGNED ] ; then
156 globalignorepatterns="$globalignorepatterns
157 WARNING: untrusted versions
158 Ignoring these trust violations"
159 fi
160 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
161 # Here you can define your own patterns. Put one pattern in a line,
162 # do not create empty lines.
163 myerrorpatterns="X_X-X_XX"
164 myignorepatterns="X_X-X_XX"
165 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
166 # The main routine
167 errorpatterns="$globalerrorpatterns
168 $myerrorpatterns"
169 ignorepatterns="$globalignorepatterns
170 $myignorepatterns"
171
172 cd $LOGDIR || exit 3
173 if [ -s $errfile ]; then
174 echo "Errorfile already exists. Aborting." >&2
175 exit
176 fi
177
178 grep -i "$errorpatterns" *.log | grep -vi "$ignorepatterns" > $errfile
179 if [ "$verbose" ]; then
180 egrep -v '^software.log:' $errfile > $LOGDIR/tempfile
181 mv $LOGDIR/tempfile $errfile
182 fi
183
184 if [ -s $errfile ]; then
185 echo "ERRORS found in log files. See $errfile" >&2
186 else
187 echo "Congratulations! No errors found in log files."
188 fi