Skip to content

Commit

Permalink
New challenge: Check if linux-arbeitsplatz-unix is running #76
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean28518 committed Apr 19, 2024
1 parent e64d803 commit 97ae4e0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lac/idm/challenges.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,10 @@ def get_all_libre_workspace_challenges():
# Challenge 8: Are the email settings configured and working?
if not unix_email.are_mail_settings_configured():
challenges.append({"text": "Die E-Mail Einstellungen sind noch nicht konfiguriert oder funktionieren nicht.", "link": reverse("email_configuration")})


# Challenge 9: Is linux-arbeitsplatz-unix.service running?
if not unix.is_unix_service_running():
challenges.append({"text": "linux-arbeitsplatz-unix.service läuft aktuell nicht. Automatische Aufgaben wie Backups oder Updates werden somit nicht ausgeführt.", "link": reverse("unix_index")})

return challenges
5 changes: 5 additions & 0 deletions src/lac/unix/unix_scripts/unix.py
Original file line number Diff line number Diff line change
Expand Up @@ -917,4 +917,9 @@ def set_additional_services_control_files(start_additional_services, stop_additi
f.write(start_additional_services)
with open("maintenance/stop_additional_services.sh", "w") as f:
f.write(stop_additional_services)


def is_unix_service_running():
"""Checks if linux-arbeitsplatz-unix.service is running"""
return os.system("systemctl is-active --quiet linux-arbeitsplatz-unix") == 0

0 comments on commit 97ae4e0

Please sign in to comment.