-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
Currently there is a whole dependency forest just to start a couple of startup scripts in order. Additionally all the services also have a dependency on all the startup scripts. This is unnecessary complex, simplify it: Move startup scripts to /etc/s6-overlay/startup.d Create oneshot service named "startup" which executes all files in /etc/s6-overlay/startup.d in alphabetical order Remove various oneshot scripts from longrun service dependencies Add "startup" oneshot service to longrun service dependencies The oneshot service to start all scripts in /etc/s6-overlay/startup.d could be included in the baseimage after some testing and if that's something sdr-enthusiasts is interested in. The script was tested against an empty or non-existent directory as well and just exits 0 in that case. If one of started scripts exits with an error, it will announce it and propagate the error. This preserves the behaviour of the container startup being aborted in that case.
- Loading branch information
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/sh | ||
exec /etc/s6-overlay/scripts/startup |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/command/with-contenv bash | ||
# shellcheck shell=bash disable=SC1091,SC2076 | ||
|
||
source /scripts/common | ||
|
||
SDIR=/etc/s6-overlay/startup.d | ||
|
||
# exit 0 for nonexistent or empty directory | ||
if ! [[ -d "$SDIR" ]] || [[ -z "$(ls "$SDIR")" ]]; then | ||
exit 0 | ||
fi | ||
|
||
for NAME in "$SDIR"/*; do | ||
if ! s6wrap --quiet --prepend="$NAME" --timestamps --args "$NAME"; then | ||
s6wrap --quiet --prepend=startup --timestamps --args echo Error running "$NAME" | ||
exit 1 | ||
fi | ||
done |