update to db59a1a2dd 2019-03-07
[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 libgpg-error-dev
68 libgpg-error0
69 Opts:.\+errors=remount
70 [RT]X packets:
71 WARNING: unexpected IO-APIC
72 warned about = ( )
73 daemon.warn
74 kern.warn
75 rw,errors=
76 Expect some cache
77 no error
78 failmsg
79 RPC call returned error 101
80 deverror.out
81 (floppy), sector 0
82 mount version older than kernel
83 Can't locate module
84 Warning only .\+MB will be used.
85 hostname: Host name lookup failure
86 I can't tell the difference.
87 warning, not much extra random data, consider using the -rand option
88 confC._FILE
89 Warning: 3 database(s) sources
90 were not found, (but were created)
91 removing exim
92 The home dir you specified already exists.
93 No Rule for /usr/lib/ispell/default.hash.
94 /usr/sbin/update-fonts-.\+: warning: absolute path
95 hostname: Unknown server error
96 EXT2-fs warning: checktime reached
97 RPC: sendmsg returned error 101
98 can't print them to stdout. Define these classes
99 warning: downgrading
100 suppress emacs errors
101 echo Error:
102 Can't open dependencies file
103 documents in /usr/doc are no longer supported
104 if you have both a SCSI and an IDE CD-ROM
105 Warning: /proc/ide/hd?/settings interface is obsolete, and will be removed soon
106 Monitoring disabled
107 Error: only one processor found.
108 Error Recovery Strategy:
109 sector 0 does not have an
110 syslogin_perform_logout: logout() returned an error
111 grub is not in an XFS filesystem.
112 grub-install: line 374:
113 grub-probe: error: Cannot open \`/boot/grub/device.map'
114 is harmless
115 not updating .\+ font directory data.
116 register_serial(): autoconfig failed
117 Fontconfig error: Cannot load default config file
118 asking for cache data failed
119 However, I can not read the target:
120 Warning: The partition table looks like it was made
121 task_error=0
122 task_local_error=0
123 ^info: Trying to set
124 warning: /usr/lib/X11/fonts
125 can't read /etc/udev/rules.d/z25_persistent-net.rules
126 /cow': No such file or directory
127 Dummy start-stop-daemon called
128 X: bytes packets errors
129 ACPI Error
130 ACPI Warning
131 AE_NOT_FOUND
132 conflicts with ACPI region
133 cannot stat \`/etc/modprobe.d/\*.conf'
134 cdrom: open failed.
135 libgpg-error
136 process \`kudzu' used the deprecated sysctl system call
137 PM: Resume from disk failed
138 JBD: barrier-based sync failed
139 aufs: module is from the staging directory, the quality is unknown
140 warning: linuxlogo stop runlevel arguments (none) do not match
141 insserv: warning: script .\+ missing LSB tags and overrides
142 live-premount.\+ If this fails
143 cannot read table of mounted file systems
144 error: no alternatives for
145 ERST: Error Record Serialization Table (ERST) support is initialized
146 ERST: Table is not found
147 HEST: Table not found
148 failed to stat /dev/pts
149 Failed to connect to socket /var/run/dbus/system_bus_socket
150 fail to add MMCONFIG information
151 can't initialize iptables table
152 can't initialize ip6tables table
153 Authentication warning overridden
154 41-warning.sh
155 PCCT header not found
156 Download is performed unsandboxed as root as file
157 update-alternatives: warning: skip creation of
158 loop: module verification failed: signature
159 Warning: apt-key output should not be parsed
160 WARNING: Failed to connect to lvmetad. Falling back to device scanning
161 Warning: The home dir /var/lib/usbmux you specified
162 diff: /var/lib/apparmor/profiles/.apparmor.md5sums: No such file or directory
163 error reporting disabled
164 Enabling Firmware First mode for corrected errors
165 errors: 0
166 0 errors
167 Memory Error Correction:
168 Memory Controller 0 - Channel . Error
169 IIO RAS/Control Status/Global Errors
170 __stack_chk_fail
171 grub.cfg.new: Directory nonexistent
172 update-rc.d: warning: start and stop actions are no longer supported"
173
174 # add pattern on some conditions
175 if [ -n $FAI_ALLOW_UNSIGNED ] ; then
176 globalignorepatterns="$globalignorepatterns
177 WARNING: untrusted versions
178 WARNING: The following packages cannot be authenticated
179 Ignoring these trust violations"
180 fi
181 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
182 # Here you can define your own patterns. Put one pattern in a line,
183 # do not create empty lines.
184 myerrorpatterns="X_X-X_XX"
185 myignorepatterns="X_X-X_XX"
186 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
187 # The main routine
188 errorpatterns="$globalerrorpatterns
189 $myerrorpatterns"
190 ignorepatterns="$globalignorepatterns
191 $myignorepatterns"
192
193 cd $LOGDIR || exit 3
194 if [ -s $errfile ]; then
195 echo "Errorfile already exists. Aborting." >&2
196 exit
197 fi
198
199 grep -i "$errorpatterns" *.log | grep -vi "$ignorepatterns" > $errfile
200 if [ X$verbose = X1 ]; then
201 egrep -v '^software.log:' $errfile > $LOGDIR/tempfile
202 mv $LOGDIR/tempfile $errfile
203 fi
204
205 if [ -s $errfile ]; then
206 echo "ERRORS found in log files. See $errfile" >&2
207 else
208 echo "Congratulations! No errors found in log files."
209 fi