mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-13 10:30:16 +00:00
container: Work in the absence of systemd in PATH, for eg. in Arch
Closes: #2072
This commit is contained in:
parent
95236bcb78
commit
c1f2b32b94
@ -382,8 +382,12 @@ def _verify_dependencies():
|
|||||||
|
|
||||||
def _get_systemd_nspawn_version():
|
def _get_systemd_nspawn_version():
|
||||||
"""Retrieve and store systemd-nspawn version (same as systemd)."""
|
"""Retrieve and store systemd-nspawn version (same as systemd)."""
|
||||||
process = subprocess.run(['systemd', '--version'], stdout=subprocess.PIPE,
|
try:
|
||||||
check=True)
|
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
|
global systemd_version
|
||||||
systemd_version = float(process.stdout.decode().split()[1])
|
systemd_version = float(process.stdout.decode().split()[1])
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user