EC2でjupyterを自動的に起動

Ubuntu 18.04.3 LT

/etc/systemd/system/jupyter.serviceにファイルつくる

[Unit]
Description = jupyter daemon

[Service]
ExecStart = /home/ubuntu/.local/bin/jupyter notebook --config=/home/ubuntu/.jupyter/jupyter_notebook_config.py
User=ubuntu
Restart = always
Type = simple

[Install]
WantedBy = multi-user.target

`systemctl list-unit-files`でjupyterが登録されているかチェック

`sudo systemctl enable jupyter`で動作するようにして`sudo systemctl start jupyter`で動かしてみて`sudo systemctl status jupyter`でステータスチェック

`jupyter.service`を直したら`sudo systemctl daemon-reload`で読み込み直す