[systemd-devel] journald not associating log messages with service

Ian Pilcher arequipeno at gmail.com
Tue Jul 28 17:12:09 UTC 2020


On 7/28/20 9:44 AM, Lennart Poettering wrote:
> Is the service short-lived? There's a race: if a process runs very
> quickly and logs journald might process the message after the process
> already exited, i.e. at a time where we can't read the cgroup off the
> process anymore.

It is indeed a very short-lived "service".  (All it does is check a
few things, write 1 value to a sysfs file, and exit.)

> You can artifically delay your service's exit (sleep 10...) but it's
> still racy and sucks hard. You could issue the equivalent of
> "journalctl --sync" at the end of your program...

Is there an API for that?

-- 
========================================================================
                  In Soviet Russia, Google searches you!
========================================================================



More information about the systemd-devel mailing list