You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
451 B

#!/bin/bash
# A wrapper script for running Jupyter notebook in a lxc-container that
# addresses two issues:
# - IPython kernels constantly crash when run with PID == 1
# - send signals to the process for a proper shutdown when the container
# receives a TERM signal
_terminate() {
kill -SIGINT $PID
kill -SIGINT $PID
}
trap _terminate SIGTERM
trap _terminate SIGINT
jupyter notebook --port 8888 --ip=* "${@}" &
PID=$!
wait $PID
exit $?