#!/bin/bash
#
# Container entrypoint that waits for all spawned processes.
#
# Create a FIFO and start reading from its read end.
tempdir=
done="/pipe"
& waiter=
# Start the workload. Its descendants will inherit the FIFO's write end.
status=0
if [; then
|| status=
else
|| status=
fi
# When the workload and all of its descendants exit, the FIFO's write end will
# be closed and `cat "$done"` will exit. Wait until it happens. This is needed
# in order to handle SelfUpdater, which the workload may start in background
# before exiting.