vim /etc/systemd/system/jupyter.service
[Unit] Description=Jupyter Notebook After=network.target [Service] Type=simple ExecStart=/home/gc/anaconda3/bin/jupyter-notebook --config=/home/wewewt/.jupyter/jupyter_notebook_config.py --no-browser User=wewewt Group=wewewt WorkingDirectory=/home/gc/py #文件路径名 Restart=always RestartSec=10 [Install] WantedBy=multi-user.target
systemctl enable jupyter #设置开机自启
systemctl start jupyter #启动