Dne 11.1.2011 16:54, Denys Vlasenko napsal(a):
A few ideas how to extend it to pick up config files from a subdir so that other packages can add/modify post-create event handling:
(1) [include] /etc/abrt/event.post-create.d/
It's good to keep the possibility to statically analyze the config file(s) when we already use it. I don't see the disadvantage of this proposal (extending the parser and adding "magic" lines) as too much limiting.
What about merging all event.*.d/ directories into a single one? We can include only events of a particular type from all files:
[include] EVENT=post-create /etc/abrt/events.d/
More fine-grained configuration (redirection of one event to another event):
[include] EVENT=post-create SOURCE_EVENT=collect_data /etc/abrt/events.d/
(2) EVENT=post-create abrt-handle-crashdump -d "$DUMP_DIR" -e "$EVENT" -c /etc/abrt/event.post-create.d/
We probably need to statically determine whether a particular dump has any defined reporting events, as you write in the comment about proposal (1). Otherwise it looks nice.
(3) EVENT=post-create for f in /etc/abrt/event.post-create.d/* do test -f "$f" || continue abrt-handle-crashdump -d "$DUMP_DIR" -e "$EVENT" -c "$f" || break done
The possibility to write multi-line commands improves readability indeed.
Karel