Hi,
This patch splits abrt-dump-oops into a generic log watcher tool,
abrt-watch-log, and oops finder, which retains the name
abrt-dump-oops:
$ abrt-watch-log --help
Usage: abrt-watch-log [-vsw] FILE PROG [ARGS]
Watch log file FILE, run PROG when it grows or is replaced
-v, --verbose Be verbose
-s Log to syslog
-w Do not exit, watch FILE for changes
$ abrt-dump-oops --help
Usage: abrt-dump-oops [-vsox] [-d DIR]/[-D]
Extract oops from standard input
-v, --verbose Be verbose
-s Log to syslog
-o Print found oopses on standard output
-d DIR Create ABRT dump in DIR for every oops found
-D Same as -d DumpLocation, DumpLocation is specified in
abrt.conf
-x Make the problem directory world readable
Instead of running
abrt-dump-oops -rwxD /var/log/messages
about the same effect is achieved by
abrt-watch-log -w /var/log/messages -- abrt-dump-oops -xD
This opens up a possibility to have other log files watched,
with different processing apps.
Problems:
* How to kill a log watcher which watches particular file?
Ideas:
* Add --match='STR' and --match-regex='REGEX' switches to limit the
frequency
of executions of the helper.
* Remove -w switch as redundant?
* Retain optional FILE parameter of abrt-dump-oops?
1.patch is preparatory, it removes old abrt-dump-oops.c -
otherwise it's hard to read the changes.
2.patch is the gist of the change.
Please review.
--
vda