Linux添加service服务文件

vim /lib/systemd/system/jupyter.service / 这个目录不同发行版可能也不同

[Unit]
Description=jupyter
After=network.target
[Service]
Tpye=forking
EnvironmentFile=/usr/local/bin/jupyter-notebook
ExecStart=/usr/local/bin/jupyter-notebook
ExecStop=/usr/bin/pkill jupyter-notebook
KillMode=process
Restart=on-failure
RestartSec=30s
[Install]
WantedBy=multi-user.target

创建好之后再操作下就行了 bash systemctl daemon-reload systemctl start jupyter systemctl enable jupyter