From: Justin Kromlinger Date: Wed, 8 Oct 2025 14:55:09 +0000 (+0200) Subject: Drop `machine-id` OSC event field if /etc/machine-id doesn't exist X-Git-Tag: v259-rc1~355 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0fe45b98dd737da86fcbb703809ebf2163c397f3;p=thirdparty%2Fsystemd.git Drop `machine-id` OSC event field if /etc/machine-id doesn't exist While we can safely assume that `/proc/sys/kernel/random/boot_id` exists, the same can't be said for `/etc/machine-id` in environments where systemd is installed, but not running. An example would be OCI containers like with the official Arch Linux image, see [0]. Without this check the prompt would constantly output `/etc/machine-id: no such file or directory` with the OSC events introduced in dadbb34 (v258). [0] https://gitlab.archlinux.org/archlinux/archlinux-docker/-/issues/107 --- diff --git a/profile.d/80-systemd-osc-context.sh b/profile.d/80-systemd-osc-context.sh index 13f04994ce2..a7392eedba2 100644 --- a/profile.d/80-systemd-osc-context.sh +++ b/profile.d/80-systemd-osc-context.sh @@ -24,7 +24,10 @@ __systemd_osc_context_escape() { } __systemd_osc_context_common() { - printf ";user=%s;hostname=%s;machineid=%s;bootid=%s;pid=%s" "$USER" "$HOSTNAME" "$(