---------- Původní zpráva ---------- Od: Lennart Poettering mzerqung@0pointer.de Komu: Development discussions related to Fedora <devel@lists.fedoraproject. org> Datum: 6. 12. 2016 11:11:48 Předmět: Re: F26 System Wide Change: Enable coredumpctl by default
"On Tue, 06.12.16 10:16, Miroslav Suchý (msuchy@redhat.com) wrote:
Dne 6.12.2016 v 09:52 Gerd Hoffmann napsal(a):
Hmm, isn't this as easy as abrt being able to find and analyze coredumps written by coredumpctl (in addition to the coredumps written by the abrt dumper)?
Yes, it is quite easy. But ABRT cannot do this query every second/minute/
hour. So systemd should have mechanism which
notify ABRT that there is new dump (by push event).
abrt can watch the journal relatively easily. In essence, abrt should store away a "cursor" (which is a short string that identifies a location in the journal), that indicates the location it last read from. And then when running continously:
1. Open the journal sd_journal_open() 2. restrict the output that you only see coredumps with sd_journal_add_match() specifying a match of: MESSAGE_ID=fc2e22bc6ee647b6b 90729ab34a250b1 2. If abrt previously stored a cursor, use it with sd_journal_seek_cursor() 3. now iterate through the journal: use sd_journal_enumerate_data()/sd_ journal_restart_data() to get any data you want for one specific journal entry, and then sd_journal_next() to skip to the next. 4. For each entry you want the raw naked coredump for: use the data included in the COREUMP field if it is there. If not, there's COREDUMP_FILENAME= which contains the coredump filename. 5. If you reached the end of the journal, use sd_journal_wait() to wait for more entries as they arrive.
The man in particular of sd_journal_next() and sd_journal_wait() have longer examples.
There's currently no concept of "service activation by coredump". That's mostly because it's quite hard to do in a race-free fashion. It's not sufficient to simply make systemd-coredump call out to abrt, as that ignores that coredumps can happen during early boot and late shutdown, and there hence should be an asynchronous element: processes that happen early on or in the last boot cycle should be processed during the normal runtime.
"
Thank you. The service watching journald for coredumps saved by systemd- coredump already exists:
http://abrt.readthedocs.io/en/latest/examples.html#getting-core-files-from- systemd-coredumctl
Jakub
" "