Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2025-06-25 23:03:12 +01:00
parent b9d57d2d58
commit aca10fdc66
12 changed files with 420 additions and 425 deletions

View File

@@ -65,20 +65,20 @@ cron
PHPRC="$(dirname "$(readlink -f "$(which php)")")/../lib/php.ini"
export PHPRC
pidfile=$(mktemp)
PIDFILE=$(mktemp)
# shellcheck disable=SC2016
setsid sh -c '
echo "$$" > "$1"
shift
exec httpd "$@"
' _ "$pidfile" "$@" &
' _ "$PIDFILE" "$@" &
until [ -s "$pidfile" ]; do sleep 0.01; done
until [ -s "$PIDFILE" ]; do sleep 0.01; done
pid=$(cat "$pidfile")
rm "$pidfile"
PID=$(cat "$PIDFILE")
rm "$PIDFILE"
trap 'kill -INT "$pid"' INT
wait "$pid"
trap 'kill -INT "$PID"' INT
wait "$PID"
exit $?