From: Daan De Meyer Date: Thu, 6 Feb 2025 11:49:10 +0000 (+0100) Subject: Check if systemd is actually running before using run0 X-Git-Tag: v26~412 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba189db599b47306a2287b5cd1c2ff739179be26;p=thirdparty%2Fmkosi.git Check if systemd is actually running before using run0 If we're not running systemd, we can't use run0 either, so use sudo in that case. --- diff --git a/mkosi/user.py b/mkosi/user.py index 41186a695..37ead626d 100644 --- a/mkosi/user.py +++ b/mkosi/user.py @@ -189,4 +189,4 @@ def become_root_cmd() -> list[str]: if os.getuid() == 0: return [] - return ["run0"] if find_binary("run0") else ["sudo"] + return ["run0"] if find_binary("run0") and Path("/run/systemd/system").exists() else ["sudo"]