ubuntu下将JupyterLab运行为系统服务

创建服务描述文件:

#/etc/systemd/system/jupyter.service

编辑文件:

sudo vim /etc/systemd/system/jupyter.service

把下面的内容复制进去:

[Unit]
Description=Jupyter
After=syslog.target network.target

[Service]
User=supermap
WorkingDirectory=/home/supermap/
ExecStart=/home/supermap/Envirment/anaconda3/bin/jupyter lab

Restart=on-failure
RestartSec=10

[Install]
WantedBy=multi-user.target

重新载入服务:

sudo systemctl daemon-reload

启动服务:

sudo systemctl start jupyter

查看状态:

sudo systemctl status jupyter --no-pager

可以看到相应的登录地址和token等信息,将其输入浏览器即可访问。

设置为系统启动时自动启动:

sudo systemctl enable jupyter
添加新评论