Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to start ipython notebook server at boot as daemon

Tags:

I love ipython, especially the notebook feature. I currently keep a screen session running with the notebook process in it. How would I add ipython's notebook engine/webserver to my system's (CentOS5) startup procedures?

like image 348
Travis Leleu Avatar asked Jan 12 '13 20:01

Travis Leleu


1 Answers

vi /usr/lib/systemd/system/ipython-notebook.service
#put the following in there.
-----------------8<------------------
    [Unit]
    Description=IPython notebook

    [Service]
    Type=simple
    PIDFile=/var/run/ipython-notebook.pid
    ExecStart=/usr/bin/ipython notebook --no-browser
    User=ipynb
    Group=ipynb
    WorkingDirectory=/home/ipynb/notebooks

    [Install]
    WantedBy=multi-user.target
-----------------8<------------------

# useradd ipynb
# su - ipynb # go there create notebooks dir
# systemctl daemon-reload
# systemctl enable ipython-notebook
# systemctl start ipython-notebook

credits

like image 85
ticktock Avatar answered Sep 22 '22 13:09

ticktock