From 32fd4097f89440c29fc0556d5a0372cf2f253f0a Mon Sep 17 00:00:00 2001 From: "Jeffrey C. Ollie" Date: Mon, 29 Jul 2024 16:02:05 -0500 Subject: [PATCH] loosen up systemd check because some systems block access to /proc//exe --- src/os/systemd.zig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/os/systemd.zig b/src/os/systemd.zig index 22aec57f7..5aeffdc24 100644 --- a/src/os/systemd.zig +++ b/src/os/systemd.zig @@ -47,7 +47,9 @@ pub fn launchedBySystemd() bool { var link_buf: [std.fs.max_path_bytes]u8 = undefined; const link = std.fs.readLinkAbsolute(path, &link_buf) catch { log.err("unable to read link '{s}'", .{path}); - break :linux false; + // Some systems prohibit access to /proc//exe for some + // reason so don't fail if we can't read the link. + break :linux true; }; if (std.mem.endsWith(u8, link, "/systemd")) break :linux true;