Jupyter Lab 부팅시마다 실행하기

안될 때는 어떻게 해도 잘 안되는 그런 것들이 있다.

리눅스에서 부팅할 때마다 특정 프로그램을 실행하는 것도 여기에 해당되는 것이라고 할 수 있겠다. 가장 정석(?)에 가까운 방법은 services를 생성하는 것이다. Jupyter Lab도 마찬가지 방법으로 실행하여 보기로 한다.

/etc/systemd/system/jupyter.service 파일을 만들어서 다음과 같은 내용을 기반으로 수정하여 작성한다.


[Unit]
Description=Jupyter Lab

[Service]
ExecStart=/home/계정/.local/bin/jupyter-lab \
--ip=* \
--no-browser \
--config="/home/계정/.jupyter/jupyter_lab_config.py"
User=계정
WorkingDirectory=/home/계정/notebook/ #작업 폴더

[Install]
WantedBy=multi-user.target

저장한 이후에는 다음의 명령어를 이용해서 등록시킨다.

sudo systemctl daemon-reload
sudo systemctl enable jupyter
sudo systemctl start jupyter