From fedbbdf3fb57a5ae66d04a04deb7e0203dd58c10 Mon Sep 17 00:00:00 2001 From: Josh Friend Date: Sat, 18 Apr 2020 18:59:48 -0400 Subject: [PATCH] Set LC_ALL and LANG when starting octoprint Fixes errors from Click about ASCII encoding: RuntimeError: Click will abort further execution because Python 3 was configured to use ASCII as encoding for the environment This system supports the C.UTF-8 locale which is recommended. You might be able to resolve your issue by exporting the follow export LC_ALL=C.UTF-8 export LANG=C.UTF-8 --- AUTHORS.md | 1 + scripts/README.md | 22 ++++++++++++++++++++++ scripts/octoprint.service | 2 ++ 3 files changed, 25 insertions(+) diff --git a/AUTHORS.md b/AUTHORS.md index cce0893dc..bf36f852e 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -118,6 +118,7 @@ date of first contribution): * [Jim Neill](https://github.com/jneilliii) * [Dustin Kerber](https://github.com/kerber) * [Tobias Schürg](https://github.com/tobiasschuerg) + * [Josh Friend](https://github.com/joshfriend) OctoPrint started off as a fork of [Cura](https://github.com/daid/Cura) by [Daid Braam](https://github.com/daid). Parts of its communication layer and diff --git a/scripts/README.md b/scripts/README.md index 51da00e50..14792931b 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -4,14 +4,36 @@ Assumes OctoPrint is installed under user pi at /home/pi/OctoPrint/venv/bin/octo setup you'll need to adjust octoprint.default (init) or octoprint.service (systemd) accordingly. ## init +Download the init.d files to the locations shown: ``` octoprint.default => /etc/default/octoprint octoprint.init => /etc/init.d/octoprint ``` +Next, enable and start the `octoprint` service: + +```sh +# Enable octoprint service +sudo update-rc.d octoprint defaults + +# and start it +sudo service octoprint start +``` + ## systemd +Download the systemd files to the locations shown: ``` octoprint.service => /etc/systemd/system/octoprint.service ``` + +Next, enable and start the `octoprint` service: + +```sh +# Enable octoprint service +sudo systemctl enable octoprint + +# and start it +sudo systemctl start octoprint +``` diff --git a/scripts/octoprint.service b/scripts/octoprint.service index e71e07b53..14f5d7f4b 100644 --- a/scripts/octoprint.service +++ b/scripts/octoprint.service @@ -4,6 +4,8 @@ After=network-online.target Wants=network-online.target [Service] +Environment="LC_ALL=C.UTF-8" +Environment="LANG=C.UTF-8" Type=simple User=pi ExecStart=/home/pi/OctoPrint/venv/bin/octoprint