[systemd-devel] Callback or Event Notification from journald in case of crash

Mantas Mikulėnas grawity at gmail.com
Tue Apr 12 07:19:11 UTC 2016


On Wed, Apr 6, 2016 at 7:04 AM, P.R.Dinesh <pr.dinesh at gmail.com> wrote:

> I am using systemd, journald and systemd-coredump in my system.  When a
> process crashes the systemd-coredump util handles the core dump and logs a
> message in the journal with MESSAGE_ID=fc2e22bc6ee647b6b90729ab34a250b1
>
> Now I want to add a routine which will do post crash activities, For eg.,
> blinking a fault led in the system.
>
> I think we can poll the journal for the crash message, but is there any
> other optimal way to register for a callback from journal which will be
> triggered whenever a message of particular MESSAGE_ID is received.
>

Well, you can use sd_journal_get_fd()+poll() instead of periodic checking,
but other than that, there aren't any sort of callbacks yet – you'll have
to filter out messages on your side.

Though I wonder if systemd-journal-remote could help here? If there are
multiple clients, doing the filtering in sd-journal-remote would probably
be more efficient than in each client...

-- 
Mantas Mikulėnas <grawity at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20160412/c803cc50/attachment.html>


More information about the systemd-devel mailing list