Skip to content

Instantly share code, notes, and snippets.

@jmkim
Forked from whophil/jupyter.service
Last active June 7, 2018 02:29
Show Gist options
  • Save jmkim/5ea776d4ccdbddddea2153085f529831 to your computer and use it in GitHub Desktop.
Save jmkim/5ea776d4ccdbddddea2153085f529831 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.
# Original by Doowon Kim (Doowon): https://gist.github.com/Doowon/38910829898a6624ce4ed554f082c4dd
# Edited by Phil Chiu (whophil) and WesternGun (WesternGun):
# https://gist.github.com/whophil/5a2eab328d2f8c16bb31c9ceaf23164f
# Edited by Jongmin Kim (kdzlvaids): https://gist.github.com/kdzlvaids/5ea776d4ccdbddddea2153085f529831
[Unit]
Description=Jupyter Notebook
[Service]
Type=simple
PIDFile=/run/jupyter.pid
ExecStart=/bin/bash -c "/opt/anaconda3/bin/jupyter notebook --config=/home/notebook/.jupyter/jupyter_notebook_config.py --debug > /home/notebook/log/jupyter/notebook-$(date +%Y%m%d-%H%M%S-%N).log 2>&1"
User=notebook
Group=notebook
WorkingDirectory=/home/notebook
Restart=always
RestartSec=10
#KillMode=mixed
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment