[systemd-devel] journal handling of process title changes

Lennart Poettering lennart at poettering.net
Mon Mar 24 16:12:49 PDT 2014


On Mon, 24.03.14 19:01, Patrick Donnelly (batrick at batbytes.com) wrote:

> 
> On Mon, Mar 24, 2014 at 12:30 PM, Lennart Poettering
> <lennart at poettering.net> wrote:
> > On Sun, 23.03.14 21:46, Patrick Donnelly (batrick at batbytes.com) wrote:
> >
> >> My problem is not related to race conditions. The issue is that
> >> /proc/pid/cmdline is shown instead of /proc/pid/comm for each journal
> >> entry. That is:
> >>
> >> $ journalctl --boot
> >> [...]
> >> Mar 23 21:39:01 host a.out[10697]: hi
> >> Mar 23 21:39:01 host c[10697]: bye2
> >> [...]
> >>
> >> These identifiers are being pulled from cmdline or argv[0] somehow.
> >
> > Yupp, the client side also sends an identifier to the server which is
> > used if it exists. It's container in the SYSLOG_IDENTIFIER field.
> >
> > I figure what happens for you is that when you change argv[0] the GNU
> > program_invocation_short_name variable is not updated, and sd-journal
> > picks up that variable for setting SYSLOG_IDENTIFIER.
> 
> Yes, this is it. Yay obscure glibc side-effects.
> 
> I assume I could just override SYSLOG_IDENTIFIER manually? 

Yes.

> Also, if someone could update the documentation for
> systemd.journal-fields(7) saying where SYSLOG_IDENTIFIER is derived
> (by default?), that'd probably help too.

I added a vague reference there now. I left it a bit vague on purpose,
since I don't want to document too much of glibc's own internals
(i.e. that it derives the syslog identifiers from p_i_s_n, since it's
not for us to document and thus cement this behaviour).

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list