Fix s6-overlay format error ()

Add missing shebangs that cause `S6 warning: unable to spawn ./finish: Exec format error` when `ONESHOT=true`. Fixes 

Also brings the method for killing a container via service exit inline with s6's documented method

Reviewed-on: 
This commit is contained in:
MrMeeb 2024-06-15 15:55:18 +00:00
parent 2962b45496
commit f6d067b561
Signed by: Gitea
GPG Key ID: F0F281CA810217FF
3 changed files with 20 additions and 3 deletions
root
check-one-shot.sh
etc/s6-overlay/s6-rc.d
cron
logs

@ -4,6 +4,7 @@
if [ $ONE_SHOT == "true" ]; then
# Cleanly kill container by sending kill signal to supervisor process
kill 1
echo 0 > /run/s6-linux-init-container-results/exitcode
/run/s6/basedir/bin/halt
fi

@ -1 +1,9 @@
echo "$e" > /run/s6-linux-init-container-results/exitcode
#!/command/with-contenv bash
# shellcheck shell=bash
if [ $ONE_SHOT == "false" ]; then
# Export exit code if not a ONE_SHOT
echo "$e" > /run/s6-linux-init-container-results/exitcode
fi

@ -1 +1,9 @@
echo "$e" > /run/s6-linux-init-container-results/exitcode
#!/command/with-contenv bash
# shellcheck shell=bash
if [ $ONE_SHOT == "false" ]; then
# Export exit code if not a ONE_SHOT
echo "$e" > /run/s6-linux-init-container-results/exitcode
fi