Skip to content

Commit eff5544

Browse files
committed
cli: Reset executable name
In some cases we re-exec ourselves; seeing the temporary file in there is super ugly. In general ideally in the future we support reliably querying journal logs from bootc; at least this improves things so that one can do `journalctl _COMM=bootc`. Signed-off-by: Colin Walters <[email protected]>
1 parent cc6ddc3 commit eff5544

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/src/cli.rs

+7
Original file line numberDiff line numberDiff line change
@@ -796,6 +796,13 @@ async fn usroverlay() -> Result<()> {
796796
/// Perform process global initialization. This should be called as early as possible
797797
/// in the standard `main` function.
798798
pub fn global_init() -> Result<()> {
799+
// In some cases we re-exec with a temporary binary,
800+
// so ensure that the syslog identifier is set.
801+
ostree::glib::set_prgname("bootc".into());
802+
if let Err(e) = rustix::thread::set_name(c"bootc") {
803+
// This shouldn't ever happen
804+
eprintln!("failed to set name: {e}");
805+
}
799806
let am_root = rustix::process::getuid().is_root();
800807
// Work around bootc-image-builder not setting HOME, in combination with podman (really c/common)
801808
// bombing out if it is unset.

0 commit comments

Comments
 (0)