From e8e07f0754b259a01e3639f77485d6eea38da9fa Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 8 Nov 2024 16:32:27 +0100 Subject: [kiosk-common] Clarify behavior of kiosk-setup service --- .../kiosk-common/data/etc/systemd/system/kiosk.service | 3 ++- .../data/opt/openslx/scripts/systemd-setup_kiosk | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/core/modules/kiosk-common/data/etc/systemd/system/kiosk.service b/core/modules/kiosk-common/data/etc/systemd/system/kiosk.service index dba49864..1c6c242d 100644 --- a/core/modules/kiosk-common/data/etc/systemd/system/kiosk.service +++ b/core/modules/kiosk-common/data/etc/systemd/system/kiosk.service @@ -3,6 +3,7 @@ Description=Prepare KIOSK mode Before=display-manager.service kdm.service lightdm.service [Service] +Type=forking ExecStart=/opt/openslx/scripts/systemd-setup_kiosk RemainAfterExit=true - +Restart=no diff --git a/core/modules/kiosk-common/data/opt/openslx/scripts/systemd-setup_kiosk b/core/modules/kiosk-common/data/opt/openslx/scripts/systemd-setup_kiosk index 40d39a6c..6b4132ae 100755 --- a/core/modules/kiosk-common/data/opt/openslx/scripts/systemd-setup_kiosk +++ b/core/modules/kiosk-common/data/opt/openslx/scripts/systemd-setup_kiosk @@ -1,8 +1,24 @@ #!/bin/bash +# This is launched as a systemd service of default type forking, +# *NOT* oneshot. This is so that you can have blocking tasks in +# the sourced files, that will delay this service from being +# considered started up completely, so that any services that +# are ordered *After* this one will actually wait until everything +# is finished and we reach the final "exit 0". +# If you want to execute some longer-running task that doesn't need +# to finish before lightdm or any browser starts up (e.g. prefetch), +# you can just fork it into the background, and it will keep +# running while services ordered after this one will already get +# executed. + for file in "$0".d/*; do [ -f "$file" ] || continue # hooks for browser-related stuff + if ! bash -n "$file"; then + slxlog "kiosk-setup-syntax" "Syntax error in kiosk setup script '$file'" + continue + fi . "$file" || slxlog "kiosk-setup" "Failed to source '$file'." done -- cgit v1.2.3-55-g7522