Files
ubuntu/scripts/entrypoint.sh

23 lines
445 B
Bash
Executable File

#!/usr/bin/env bash
set -x
term_handler() {
eval $USER_COMMAND_EXIT
eval $SYS_COMMAND_EXIT
exit 143; # 128 + 15 -- SIGTERM
}
# setup handler when the container is exited
trap 'kill ${!}; term_handler' SIGTERM
# setup home directory for the current user. It is useful for attaching vscode with container.
sudo mkhomedir_helper `whoami`
touch $LOG_FILE
eval $SYS_COMMAND_INIT &
eval $USER_COMMAND_INIT &
tail -f $LOG_FILE & wait ${!}