From c1f2b32b949637060267fcf3405bcc66ce805c2b Mon Sep 17 00:00:00 2001 From: Aditya Pratap Singh Date: Fri, 26 Mar 2021 22:49:40 +0530 Subject: [PATCH] container: Work in the absence of systemd in PATH, for eg. in Arch Closes: #2072 --- container | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/container b/container index bad1aa60c..76d6c1325 100755 --- a/container +++ b/container @@ -382,8 +382,12 @@ def _verify_dependencies(): def _get_systemd_nspawn_version(): """Retrieve and store systemd-nspawn version (same as systemd).""" - process = subprocess.run(['systemd', '--version'], stdout=subprocess.PIPE, - check=True) + try: + process = subprocess.run(['systemd', '--version'], stdout=subprocess.PIPE, + check=True) + except FileNotFoundError: + process = subprocess.run(['/usr/lib/systemd/systemd', '--version'], stdout=subprocess.PIPE, + check=True) global systemd_version systemd_version = float(process.stdout.decode().split()[1])