update to 31b795ca71189b326b80666076398f31aea4f2be
[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 ^E:
28 operator expected
29 ambiguous redirect
30 No previous regular expression
31 No such
32 Device or resource busy
33 unknown option
34 [a-z]\+\.log:E:
35 No candidate version found
36 segfault
37 Couldn't find any package whose name or description matched
38 cannot create
39 The following packages have unmet dependencies"
40
41 globalignorepatterns="[a-z]\+\.log:#
42 Error: Driver 'pcspkr' is already registered, aborting
43 : bytes packets errors dropped
44 :+ error=0
45 :+ trap error=
46 task_error_func=
47 STOP_ON_ERROR=
48 courier-webadmin
49 plugins-bad
50 Enabling conf localized-error-pages
51 ibwebadmin
52 kernel-patch-badram
53 kolab-webadmin
54 kolabadmin
55 gstreamer.\+-plugins-really-bad
56 liberrors.so
57 liberrors-samba
58 libsamba-errors
59 gsambad
60 libad
61 libtest-nowarnings-perl
62 libtest-warn-perl
63 libclass-errorhandler-perl
64 zope-ploneerrorreporting
65 libroxen-errormessage
66 liberror-perl
67 perl-Error
68 libgpg-error-dev
69 libgpg-error0
70 Opts:.\+errors=remount
71 [RT]X packets:
72 WARNING: unexpected IO-APIC
73 warned about = ( )
74 daemon.warn
75 kern.warn
76 rw,errors=
77 Expect some cache
78 no error
79 failmsg
80 RPC call returned error 101
81 deverror.out
82 (floppy), sector 0
83 mount version older than kernel
84 Can't locate module
85 Warning only .\+MB will be used.
86 hostname: Host name lookup failure
87 I can't tell the difference.
88 warning, not much extra random data, consider using the -rand option
89 confC._FILE
90 Warning: 3 database(s) sources
91 were not found, (but were created)
92 removing exim
93 The home dir you specified already exists.
94 No Rule for /usr/lib/ispell/default.hash.
95 /usr/sbin/update-fonts-.\+: warning: absolute path
96 hostname: Unknown server error
97 EXT2-fs warning: checktime reached
98 RPC: sendmsg returned error 101
99 can't print them to stdout. Define these classes
100 warning: downgrading
101 suppress emacs errors
102 echo Error:
103 Can't open dependencies file
104 documents in /usr/doc are no longer supported
105 if you have both a SCSI and an IDE CD-ROM
106 Warning: /proc/ide/hd?/settings interface is obsolete, and will be removed soon
107 Monitoring disabled
108 Error: only one processor found.
109 Error Recovery Strategy:
110 sector 0 does not have an
111 syslogin_perform_logout: logout() returned an error
112 grub is not in an XFS filesystem.
113 grub-install: line 374:
114 grub-probe: error: Cannot open \`/boot/grub/device.map'
115 is harmless
116 not updating .\+ font directory data.
117 register_serial(): autoconfig failed
118 Fontconfig error: Cannot load default config file
119 asking for cache data failed
120 However, I can not read the target:
121 Warning: The partition table looks like it was made
122 task_error=0
123 task_local_error=0
124 ^info: Trying to set
125 warning: /usr/lib/X11/fonts
126 can't read /etc/udev/rules.d/z25_persistent-net.rules
127 /cow': No such file or directory
128 Dummy start-stop-daemon called
129 X: bytes packets errors
130 ACPI Error
131 ACPI Warning
132 AE_NOT_FOUND
133 conflicts with ACPI region
134 cannot stat \`/etc/modprobe.d/\*.conf'
135 cdrom: open failed.
136 libgpg-error
137 process \`kudzu' used the deprecated sysctl system call
138 PM: Resume from disk failed
139 JBD: barrier-based sync failed
140 aufs: module is from the staging directory, the quality is unknown
141 warning: linuxlogo stop runlevel arguments (none) do not match
142 insserv: warning: script .\+ missing LSB tags and overrides
143 live-premount.\+ If this fails
144 cannot read table of mounted file systems
145 error: no alternatives for
146 ERST: Error Record Serialization Table (ERST) support is initialized
147 ERST: Table is not found
148 HEST: Table not found
149 failed to stat /dev/pts
150 Failed to connect to socket /var/run/dbus/system_bus_socket
151 fail to add MMCONFIG information
152 can't initialize iptables table
153 can't initialize ip6tables table
154 Authentication warning overridden
155 41-warning.sh
156 PCCT header not found
157 Download is performed unsandboxed as root as file
158 update-alternatives: warning: skip creation of
159 loop: module verification failed: signature
160 Warning: apt-key output should not be parsed
161 WARNING: Failed to connect to lvmetad. Falling back to device scanning
162 Warning: The home dir /var/lib/usbmux you specified
163 diff: /var/lib/apparmor/profiles/.apparmor.md5sums: No such file or directory
164 error reporting disabled
165 Enabling Firmware First mode for corrected errors
166 errors: 0
167 0 errors
168 Memory Error Correction:
169 Memory Controller 0 - Channel . Error
170 IIO RAS/Control Status/Global Errors
171 RAS: Correctable Errors collector initialized
172 __stack_chk_fail
173 grub.cfg.new: Directory nonexistent
174 can't derive routing for PCI INT A
175 failed to load isci/isci_firmware.bin
176 Direct firmware load for isci/isci_firmware.bin failed with error
177 Loading user firmware failed, using default values
178 stunnel4 you specified can't be accessed: No such file or directory
179 install-docs --verbose --check file_name' may give more details about the above errors
180 cannot open '/etc/ssl/certs/java/cacerts' for reading: No such file or directory
181 can't claim BAR
182 disabling ASPM
183 data block query control method not found
184 subprocess.py.\+RuntimeWarning: line buffering
185 Resource conflict.\+ found
186 update-rc.d: warning: start and stop actions are no longer supported"
187
188 # add pattern on some conditions
189 if [ -n $FAI_ALLOW_UNSIGNED ] ; then
190 globalignorepatterns="$globalignorepatterns
191 WARNING: untrusted versions
192 WARNING: The following packages cannot be authenticated
193 Ignoring these trust violations"
194 fi
195 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
196 # Here you can define your own patterns. Put one pattern in a line,
197 # do not create empty lines.
198 myerrorpatterns="X_X-X_XX"
199 myignorepatterns="X_X-X_XX"
200 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
201 # The main routine
202 errorpatterns="$globalerrorpatterns
203 $myerrorpatterns"
204 ignorepatterns="$globalignorepatterns
205 $myignorepatterns"
206
207 cd $LOGDIR || exit 3
208 if [ -s $errfile ]; then
209 echo "Errorfile already exists. Aborting." >&2
210 exit
211 fi
212
213 grep -i "$errorpatterns" *.log | grep -vi "$ignorepatterns" > $errfile
214 if [ X$verbose = X1 ]; then
215 egrep -v '^software.log:' $errfile > $LOGDIR/tempfile
216 mv $LOGDIR/tempfile $errfile
217 fi
218
219 if [ -s $errfile ]; then
220 echo "ERRORS found in log files. See $errfile" >&2
221 else
222 echo "Congratulations! No errors found in log files."
223 fi