OctoPrintの自動起動

OctoPrint

[Ubuntuに自動起動を設定]

ファイルを作成し、以下に入れます。

/etc/systemd/system/octoprint.service

octoprint.serviceの内容

[Unit]
Description=The snappy web interface for your 3D printer
After=network-online.target
Wants=network-online.target

[Service]
Environment="LC_ALL=C.UTF-8"
Environment="LANG=C.UTF-8"
Type=exec
User=<****>
ExecStart=/home/<****>/OctoPrint/venv/bin/octoprint serve

[Install]
WantedBy=multi-user.target

動起動するスクリプトを追加

次に、以下のコマンドを使用して自動起動するスクリプトを追加します。

sudo systemctl enable octoprint.service