Skip to content

Conversation

cgwalters
Copy link

The libsystemd code is documented to determine the syslog identifier by using
https://man7.org/linux/man-pages/man3/program_invocation_short_name.3.html (a glibc thing).

This code is parsing via looking at /proc/self/exe.

Often, these things are the same, but in my case they're not because for unfortunate reasons I need to re-exec the current binary in a tempfile.

It's actually simpler and more reliable for us anyways to match what libsystemd is doing by looking at argv[0].

The libsystemd code is documented to determine the syslog
identifier by using
https://man7.org/linux/man-pages/man3/program_invocation_short_name.3.html
(a glibc thing).

This code is parsing via looking at `/proc/self/exe`.

Often, these things are the same, but in my case they're not
because for unfortunate reasons I need to re-exec the current
binary in a tempfile.

It's actually simpler and more reliable for us anyways
to match what libsystemd is doing by looking at argv[0].

Signed-off-by: Colin Walters <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant