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