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