Skip to content

Instantly share code, notes, and snippets.

@P3GLEG
Forked from whophil/jupyter.service
Last active August 26, 2017 20:16
Show Gist options
  • Save P3GLEG/32989099e391eb449a2556b21b12ca6b to your computer and use it in GitHub Desktop.
Save P3GLEG/32989099e391eb449a2556b21b12ca6b to your computer and use it in GitHub Desktop.
A systemd script for running a Jupyter notebook server.
# After Ubuntu 16.04, Systemd becomes the default.
# It is simpler than https://gist.github.com/Doowon/38910829898a6624ce4ed554f082c4dd
# Ensure WorkDirectory exists otherwise the service won't launch correctly.
[Unit]
Description=Jupyter Notebook
[Service]
Type=simple
PIDFile=/var/run/jupyter.pid
ExecStart=/home/k4ch0w/anaconda2/bin/jupyter notebook
ExecEnd=kill -9 `cat /var/run/jupyter.pid`
User=k4ch0w
Group=k4ch0w
WorkingDirectory=/home/k4ch0w/notebooks/
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment