Skip to content

Conversation

@cgwalters
Copy link
Contributor

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]>
Copy link
Contributor

@hds hds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your PR!

@hds hds merged commit 72bfa8f into tokio-rs:main Nov 19, 2025
55 checks passed
hds added a commit that referenced this pull request Nov 25, 2025
# 0.3.2 (November 30, 2025)

### Added

- Use argv0 for syslog identifier ([#3372])

[#3372]: https://github.com/tokio-rs/tracing/pull/#3372
hds added a commit that referenced this pull request Nov 26, 2025
# 0.3.2 (November 30, 2025)

### Added

- Use argv0 for syslog identifier ([#3372])

[#3372]: https://github.com/tokio-rs/tracing/pull/#3372
hds added a commit that referenced this pull request Nov 26, 2025
# 0.3.2 (November 26, 2025)

### Added

- Use argv0 for syslog identifier ([#3372])

[#3372]: https://github.com/tokio-rs/tracing/pull/#3372
hds added a commit that referenced this pull request Nov 26, 2025
# 0.3.2 (November 26, 2025)

### Added

- Use argv0 for syslog identifier ([#3372])

[#3372]: https://github.com/tokio-rs/tracing/pull/#3372
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.

2 participants