[systemd-devel] SyslogIdentifier= no flexible enough
Windl, Ulrich
u.windl at ukr.de
Fri Aug 16 09:34:57 UTC 2024
Hi!
I'm running the same binary concurrently with different options using timers and instances, and I have the problem that it's not obvious which instance logged an error.
Like this:
Aug 16 00:00:01 v04 systemd[1]: Started Check (auth-fail-xyz).
Aug 16 00:00:01 v04 systemd[1]: Started Check (grace-logins).
Aug 16 00:00:01 v04 systemd[1]: Started Check (grace-logins-xyz).
Aug 16 00:00:01 v04 systemd[1]: Started Check (pw-expiration-xyz).
Aug 16 00:00:01 v04 systemd[1]: Started Check (auth-fail).
Aug 16 00:00:01 v04 systemd[1]: Started Check (pw-expiration).
...
Aug 16 00:00:01 v04 systemd[1]: Started Session 20118 of user root.
Aug 16 00:00:01 v04 systemd[1]: Started Session 20119 of user root.
Aug 16 00:00:01 v04 systemd[1]: Started Session 20120 of user root.
...
Aug 16 00:00:01 v04 check[15985]: [0] notification_message: undefined value of LAST_PW_CHANGE_T
Now my obvious problem is: "Which instance created PID 15985?"
I could use "SyslogIdentifier=" to set the identifier to "unit at instance", but I'd rather like to append some string (to get something like "check at instance[pid]" or "check[pid]@instance"), but then I would need the original identifier in some variable.
However variables are only set at the "unit level", so there are no special variables from the "exec level".
When setting the value to a fixed string, I will have a problem when running more then one process, obviously.
Are there any solutions to this?
Kind regards,
Ulrich
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20240816/52c20f98/attachment.htm>
More information about the systemd-devel
mailing list