[systemd-devel] FixMe need a coredump HOOK

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Sat Jun 7 14:00:28 PDT 2014


Hi,
the coredump machinery provided by the kernel only works for
user space processes. Kernel faults usually end in a traceback
being printed to the console and are handled differently.

To receive information about past and future coredumps stored
in the journal you need to:

1. Add a filter which limits entries to MESSAGE_ID=fc2e22bc6ee647b6b90729ab34a250b1
(I think you already have this)

2. retrieve a journal file descriptor which can be used for
polling with sd_journal_get_fd()

3. loop over existing entries
(You also seem to have this implemented)

4. establish a loop which will poll for journal changes.
sd_journal_wait() implements such a loop, but if you want to run this
code from a different event loop, you should add the file descriptor
received from sd_journal_get_fd() to this external event loop. This is
described in some detail in the sd_journal_wait(3) man page.

You can use 'journalctl -f MESSAGE_ID=fc2e22bc6ee647b6b90729ab34a250b1'
as a general guide.

HTH,
Zbyszek


More information about the systemd-devel mailing list