-
-
Save nokados/d9beae1ba4847c475ae97a40274d389e to your computer and use it in GitHub Desktop.
A systemd script for running a Jupyter notebook server.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# After Ubuntu 16.04, Systemd becomes the default. | |
# It is simpler than https://gist.github.com/Doowon/38910829898a6624ce4ed554f082c4dd | |
[Unit] | |
Description=Jupyter Notebook | |
[Service] | |
Type=simple | |
PIDFile=/run/jupyter.pid | |
ExecStart=/home/nokados/anaconda3/bin/jupyter-notebook --config=/home/nokados/.jupyter/jupyter_notebook_config.py --no-browser | |
User=nokados | |
Group=nokados | |
WorkingDirectory=/home/nokados | |
Restart=always | |
RestartSec=10 | |
#KillMode=mixed | |
[Install] | |
WantedBy=multi-user.target |
(Blocking request with no referer) Encountering this too, I was only able to get it to work with c.NotebookApp.disable_check_xsrf = True, which is not recommended for security reasons.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Following the instructions of https://www.digitalocean.com/community/tutorials/how-to-configure-a-linux-service-to-start-automatically-after-a-crash-or-reboot-part-1-practical-examples, place this file in:
/usr/lib/systemd/system/jupyter.service
Then execute
sudo systemctl enable jupyter.service
Reload the systemd daemona and restart the service
sudo systemctl daemon-reload
sudo systemctl restart jupyter.service