Skip to content
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

remove S6 settings which are no longer necessary / startup service improvements #168

Merged
merged 5 commits into from
Mar 23, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
5 changes: 1 addition & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@

FROM ghcr.io/sdr-enthusiasts/docker-baseimage:wreadsb

ENV S6_BEHAVIOUR_IF_STAGE2_FAILS=2 \
S6_SERVICES_GRACETIME=20000 \
S6_KILL_GRACETIME=20000 \
BEASTPORT=30005 \
ENV BEASTPORT=30005 \
GITPATH_TIMELAPSE1090=/opt/timelapse1090 \
HTTP_ACCESS_LOG="false" \
HTTP_ERROR_LOG="true" \
Expand Down
Empty file.
2 changes: 2 additions & 0 deletions rootfs/etc/s6-overlay/s6-rc.d/startup/down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
exec /etc/s6-overlay/scripts/startup-finish
8 changes: 5 additions & 3 deletions rootfs/etc/s6-overlay/scripts/startup
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ 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"
cd "$SDIR" || exit 1

for NAME in *; do
if ! s6wrap --quiet --prepend="$NAME" --timestamps --args "$SDIR/$NAME"; then
s6wrap --quiet --prepend=startup --timestamps --args echo Error running "$SDIR/$NAME"
exit 1
fi
done
20 changes: 20 additions & 0 deletions rootfs/etc/s6-overlay/scripts/startup-finish
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/command/with-contenv bash
# shellcheck shell=bash disable=SC1091,SC2076

source /scripts/common

SDIR=/etc/s6-overlay/finish.d

# exit 0 for nonexistent or empty directory
if ! [[ -d "$SDIR" ]] || [[ -z "$(ls "$SDIR")" ]]; then
exit 0
fi

cd "$SDIR" || exit 1

for NAME in *; do
if ! s6wrap --quiet --prepend="$NAME" --timestamps --args "$SDIR/$NAME"; then
s6wrap --quiet --prepend=startup --timestamps --args echo Error running "$SDIR/$NAME"
exit 1
fi
done
2 changes: 1 addition & 1 deletion rootfs/etc/s6-overlay/startup.d/01-sanity-check
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ fi

# Set up timezone
if [ -z "${TZ}" ]; then
echo "${YELLOW}WARNING: TZ environment variable not set${NOCOLOR}"
echo -e "${YELLOW}WARNING: TZ environment variable not set${NOCOLOR}"
else
ln -snf "/usr/share/zoneinfo/$TZ" /etc/localtime && echo "$TZ" >/etc/timezone
fi