On Tue, 09.06.15 13:50, Martin Belanger ([email protected]) wrote:

> Hi Lennart,
> 
> I found a workaround. When looking at the source code for sd_journal_print(),
> I saw that SYSLOG_IDENTIFIER defaults to the string pointed to by
> program_invocation_short_name
> (defined in errno.h). So I simply create a new string with the text that I
> want to assign to SYSLOG_IDENTIFIER and I make program_invocation_short_name
> point to it.
> 
> It may not be the prettiest fix, but it works for the daemons I'm
> instantiating.

Ah, yes, if you want to set this from your process internally, then
setting program_invocation_short_name is actually completely OK. I
don't even think it's ugly in any way. It's the short identifier for
the program used on GNU, and it's initialized by argv[0] but you can
set it to anything you like.

Lennart

-- 
Lennart Poettering, Red Hat
_______________________________________________
systemd-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to