jupyter-lab设置自启动及远程连接开发环境
1 创建JupyterLab运行脚本
首先找到jupyter-lab命令的位置,一般在~/.local/bin/下,可以创建shell脚本autoJupyterLab.sh:
#!/bin/sh /home/myjetson/.local/bin/jupyter-lab
测试一下脚本的正确性::
./autoJupyterLab.sh
远程连接JupyterLab成功,说明运行脚本没问题。
2 添加JupyterLab Service文件
Ubuntu18通过systemd管理服务,因此添加服务来开机运行JupyterLab脚本。
服务Service保存在/lib/systemd/system和/etc/systemd/system下。在/etc/systemd/system下创建auto-jupyter.service服务:
[Unit] Description=Auto Load JupyterLab After=network.target [Service] Type=simple User=your_username ExecStart=/your_script_dir/autoJupyterLab.sh Restart=on-failure RestartSec=15s [Install] WantedBy=multi-user.target
3 设置Jupyter Service自启动
让systemd重新加载service文件:
sudo systemctl daemon-reload
然后设置auto-jupyter.service开机自启:
sudo systemctl enable auto-jupyter.service
这样配置就完成了。
4 测试自启动服务
试着手动运行auto-jupyter.service,看看服务写的有没有问题:
sudo systemctl start auto-jupyter.service sudo systemctl status auto-jupyter.service
重启服务器,远程连接jupyterlab,大功告成!
到此这篇关于jupyter-lab设置自启动及远程连接开发环境的文章就介绍到这了,更多相关jupyter-lab设置自启动及远程连接内容请搜索脚本之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持脚本之家!
相关文章
django ManyToManyField多对多关系的实例详解
今天小编就为大家分享一篇django ManyToManyField多对多关系的实例详解,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧2019-08-08python_matplotlib改变横坐标和纵坐标上的刻度(ticks)方式
这篇文章主要介绍了python_matplotlib改变横坐标和纵坐标上的刻度(ticks)方式,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧2020-05-05Python操作RabbitMQ服务器实现消息队列的路由功能
RabbitMQ是一个消息队列服务器,这里我们针对Python+Pika+RabbitMQ的服务器端环境,来看一下如何使用Python操作RabbitMQ服务器实现消息队列的路由功能2016-06-06
最新评论