Re: journald not associating log messages with service

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Di, 28.07.20 12:12, Ian Pilcher (arequipeno@xxxxxxxxx) wrote:

> 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?

Yes, but not in v219... That's just ancient, sorry.

On newer version it's a Varlink API.

Lennart

--
Lennart Poettering, Berlin
_______________________________________________
systemd-devel mailing list
systemd-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/systemd-devel



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux