diff --git a/lib/init/kiln-controller b/lib/init/kiln-controller deleted file mode 100644 index ab99caf..0000000 --- a/lib/init/kiln-controller +++ /dev/null @@ -1,32 +0,0 @@ -### BEGIN INIT INFO -# Provides: Start kiln-controller server -# Required-Start: $remote_fs $syslog -# Required-Stop: $remote_fs $syslog -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Start kiln-controller Server -# Description: picoFlow On Raspberry Pi -### END INIT INFO - - -#! /bin/sh -# /etc/init.d/kiln-controller - - -export HOME -case "$1" in - start) - echo "Starting kiln-controller Server" - /home/pi/kiln-controller/venv/bin/python /home/pi/kiln-controller/kiln-controller.py 2>&1 & - ;; - stop) - echo "Stopping kiln-controller Server" - reflow_PID=`ps auxwww | grep kiln-controller.py | head -1 | awk '{print $2}'` - kill -9 $reflow_PID - ;; - *) - echo "Usage: /etc/init.d/kiln-controller {start|stop}" - exit 1 - ;; -esac -exit 0 diff --git a/lib/init/kiln-controller.service b/lib/init/kiln-controller.service new file mode 100644 index 0000000..318e4c0 --- /dev/null +++ b/lib/init/kiln-controller.service @@ -0,0 +1,8 @@ +[Unit] +Description=kiln-controller + +[Service] +ExecStart=/home/pi/kiln-controller/venv/bin/python /home/pi/kiln-controller/kiln-controller.py + +[Install] +WantedBy=multi-user.target diff --git a/start-on-boot b/start-on-boot new file mode 100755 index 0000000..5f02dae --- /dev/null +++ b/start-on-boot @@ -0,0 +1,3 @@ +#!/bin/bash +sudo cp /home/pi/kiln-controller/lib/init/kiln-controller.service /etc/systemd/system/ +sudo systemctl enable kiln-controller