Created
April 18, 2018 01:42
-
-
Save paulochf/64d90ddbfda12fbd693afe5960f70d9e to your computer and use it in GitHub Desktop.
Jupyter Notebook as service in Ubuntu
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 | |
# https://gist.github.com/whophil/5a2eab328d2f8c16bb31c9ceaf23164f | |
# PUT THIS IN /usr/lib/systemd/system | |
[Unit] | |
Description=Jupyter Notebook | |
[Service] | |
Type=simple | |
PIDFile=/run/jupyter.pid | |
ExecStart=<path to env>/bin/jupyter-notebook | |
User=ubuntu | |
Group=ubuntu | |
WorkingDirectory=<Jupyter server working directory> | |
Restart=always | |
RestartSec=10 | |
Environment=SOME_ENV_VAR=SOME_ENV_VALUE | |
#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