我喜欢ipython,尤其是笔记本的特性。我目前在一个屏幕会话中运行着notebook进程。如何将ipython的笔记本引擎/ add服务器添加到我的系统(CentOS5)启动过程中?
发布于 2016-03-10 19:17:25
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
发布于 2013-01-13 06:45:59
也许可以这样写:
cd /path/to/notebookdir && ipython notebook --no-browser &
在/etc/rc.d/rc.local
?这是一种“简单”的方式,如果它只是你的个人机器,我认为很好,但如果它是一台“真正的”服务器,你可能应该做一个完整的Sys init事情;有关更多信息,请参阅this question
发布于 2015-09-08 05:41:27
我假设您不想以root用户身份运行该程序。这是我修改后的版本,作为<username>
运行(将/etc/rc.local
放在exit 0
行之前):
su <username> -c "/usr/bin/ipython notebook --no-browser --profile <profilename> &"
您可以使用which ipython
检查以确保您的ipython位于该路径。尽管你可能不会把完整的路径放在一起。
https://stackoverflow.com/questions/14297741
复制相似问题