Skip to content

Instantly share code, notes, and snippets.

@baoyunfan
Forked from whophil/jupyter.service
Created August 20, 2017 20:32
Show Gist options
  • Select an option

  • Save baoyunfan/8106c266a7864ded08d9896c9ad76c3d to your computer and use it in GitHub Desktop.

Select an option

Save baoyunfan/8106c266a7864ded08d9896c9ad76c3d to your computer and use it in GitHub Desktop.

Revisions

  1. @whophil whophil revised this gist Aug 27, 2016. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions jupyter.service
    Original file line number Diff line number Diff line change
    @@ -7,7 +7,7 @@ Description=Jupyter Notebook
    [Service]
    Type=simple
    PIDFile=/run/jupyter.pid
    ExecStart=/usr/local/bin/jupyter notebook --no-browser --config=/home/phil/.jupyter/jupyter_notebook_config.py
    ExecStart=/home/phil/Enthought/Canopy_64bit/User/bin/jupyter-notebook --config=/home/phil/.jupyter/jupyter_notebook_config.py
    User=phil
    Group=phil
    WorkingDirectory=/home/phil/Notebooks/
    @@ -16,4 +16,4 @@ RestartSec=10
    #KillMode=mixed

    [Install]
    WantedBy=multi-user.target
    WantedBy=multi-user.target
  2. @whophil whophil revised this gist Aug 27, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion jupyter.service
    Original file line number Diff line number Diff line change
    @@ -10,7 +10,7 @@ PIDFile=/run/jupyter.pid
    ExecStart=/usr/local/bin/jupyter notebook --no-browser --config=/home/phil/.jupyter/jupyter_notebook_config.py
    User=phil
    Group=phil
    WorkingDirectory=/home/Notebooks/
    WorkingDirectory=/home/phil/Notebooks/
    Restart=always
    RestartSec=10
    #KillMode=mixed
  3. @whophil whophil revised this gist Aug 14, 2016. No changes.
  4. @whophil whophil revised this gist Aug 14, 2016. 1 changed file with 0 additions and 15 deletions.
    15 changes: 0 additions & 15 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -1,15 +0,0 @@
    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

    ```shell
    sudo systemctl enable jupyter.service
    ```

    Reload the systemd daemona and restar the service
    ```shell
    sudo systemctl daemon-reload
    sudo systemctl restart jupyter.service
    ```
  5. @whophil whophil renamed this gist Aug 14, 2016. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  6. @whophil whophil revised this gist Aug 14, 2016. 2 changed files with 20 additions and 5 deletions.
    15 changes: 15 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    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

    ```shell
    sudo systemctl enable jupyter.service
    ```

    Reload the systemd daemona and restar the service
    ```shell
    sudo systemctl daemon-reload
    sudo systemctl restart jupyter.service
    ```
    10 changes: 5 additions & 5 deletions jupyter_systemd
    Original file line number Diff line number Diff line change
    @@ -1,16 +1,16 @@
    # After Ubuntu 16.04, Systemd becomes the default.
    # It is simler than https://gist.github.com/Doowon/38910829898a6624ce4ed554f082c4dd
    # It is simpler than https://gist.github.com/Doowon/38910829898a6624ce4ed554f082c4dd

    [Unit]
    Description=Jupyter Notebook

    [Service]
    Type=simple
    PIDFile=/run/jupyter.pid
    ExecStart=/usr/local/bin/jupyter notebook --no-browser --config=/home/jail/home/notebook/.jupyter/jupyter_notebook_config.py
    User=notebook
    Group=notebook
    WorkingDirectory=/home/jail/home/notebook/workdir
    ExecStart=/usr/local/bin/jupyter notebook --no-browser --config=/home/phil/.jupyter/jupyter_notebook_config.py
    User=phil
    Group=phil
    WorkingDirectory=/home/Notebooks/
    Restart=always
    RestartSec=10
    #KillMode=mixed
  7. @doowon doowon created this gist Jul 22, 2016.
    19 changes: 19 additions & 0 deletions jupyter_systemd
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    # After Ubuntu 16.04, Systemd becomes the default.
    # It is simler than https://gist.github.com/Doowon/38910829898a6624ce4ed554f082c4dd

    [Unit]
    Description=Jupyter Notebook

    [Service]
    Type=simple
    PIDFile=/run/jupyter.pid
    ExecStart=/usr/local/bin/jupyter notebook --no-browser --config=/home/jail/home/notebook/.jupyter/jupyter_notebook_config.py
    User=notebook
    Group=notebook
    WorkingDirectory=/home/jail/home/notebook/workdir
    Restart=always
    RestartSec=10
    #KillMode=mixed

    [Install]
    WantedBy=multi-user.target