SyslogIdentifier= no flexible enough

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

 



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@instance”, but I’d rather like to append some string (to get something like “check@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

 


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

  Powered by Linux