Skip to content

Allows boostrap systemd check to pass if either systemd or systemctl are found #1032

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/integration-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ jobs:
- name: "Ubuntu 24.04 Py 3.12"
distro_image: "ubuntu:24.04"
extra_flags: ""
- name: "Ubuntu 24.10 Py 3.12"
distro_image: "ubuntu:24.10"
extra_flags: ""
- name: "Ubuntu 22.04, Py 3.10, from main"
distro_image: "ubuntu:22.04"
extra_flags: --upgrade-from=main
Expand Down
10 changes: 9 additions & 1 deletion bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,14 @@ def get_os_release_variable(key):
)


def host_has_systemd() -> bool:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You've added this function, but it's not used

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good eye, whoops. I was contemplating breaking out more pieces to test before I noticed you already have an integration test suite running on GitHub Actions. I've stripped that part out, now to see if the other failures are relevant to this PR or not.

if shutil.which("systemd"):
return True
if shutil.which("systemctl"):
return True
return False


def ensure_host_system_can_install_tljh():
"""
Check if TLJH is installable in current host system and exit with a clear
Expand All @@ -229,7 +237,7 @@ def ensure_host_system_can_install_tljh():
sys.exit(1)

# Require systemd (systemctl is a part of systemd)
if not shutil.which("systemd") or not shutil.which("systemctl"):
if not any([shutil.which("systemctl"), shutil.which("systemd")]):
print("Systemd is required to run TLJH")
# Provide additional information about running in docker containers
if os.path.exists("/.dockerenv"):
Expand Down
Loading