On 01/14/2011 04:21 PM, Denys Vlasenko wrote:
On Fri, 2011-01-14 at 14:31 +0100, Jiri Moskovcak wrote:
> On 01/14/2011 02:19 PM, Denys Vlasenko wrote:
>> Patch adds new tool:
>>
>> $ abrt-dump-oops
>> Usage: abrt-dump-oops [-vsrdow] FILE
>>
>> Extract oops from syslog/dmesg file
>>
>> -v, --verbose Be verbose
>> -s Log to syslog
>> -r Parse kernel's message buffer before parsing
FILE
>> -d Create ABRT dump for every oops found
>> -o Print found oopses on standard output
>> -w Do not exit, watch the file for new oopses
>>
>> It extends dumpoops. Extensions:
>> * it can watch the syslog using -w option (uses inotify)
>> * it can scan dmesg buffer too
>>
>> In this way, it also becomes a replacement for KerneloopsScanner plugin:
>> oops-detecting logic is taken verbatim from KerneloopsScanner source.
>>
>> abrtd is changed to start it if it sees this directive in abrt.conf:
>
> - so it runs as a daemon? I don't like it and I bet a lot more people
> wont, because it will slow down the booting and it's not necessary as it
> can be run when the file changes
There are things which are hard to do, and/or ugly if the watching is
done in the daemon. From the top of my head:
* Tracking current scan position across scanner invocations would be
ugly both in design and in implementation.
* Pausing scanning between scans, and pausing it when the file is
missing (imagine that /var/log/messages is deleted and recreated
sometime after...) will require complicated logic of remembering
inotify events and delaying acting on them. IOW: some timers will need
to be added to abrtd's main loop, and it already is complicated.
- agree, I read the first proposal, so I know the problems, I just don't
like running them on boot (and many others won't like it also..)
- what about some "lazy start" like starting the parser when the log
file changes for the first time and then leave it running?
To be honest, to me log scanners, ccpp hook and the server which saves
python crashes (currently, +java etc to follow) look more like separate
services.
However, the goal of this patch is not to explore that road.
This patch wants to do with last bits of "old" plugins.
We can discuss and change the way we run services later.
- ok
>> KerneloopsScanner = /var/log/messages
>
> - I don't like this, because the name of abrt-dump-oops is then
> hardcoded somewhere, which goes against our "modular" design - how would
> you add other scanner?
>
> ... I think something like:
>
> [LogScanners]
> /var/log/messages = abrt-dump-oops
>
> would be better
We can simply list the full invocation then:
[LogScanners]
abrt-dump-oops -drw /var/log/messages
- looks ok, btw, we will need the same abrt.d/*.conf logic for the main
config file, so the scanners can be easily added/removed by just
installing the package