feat: service control

adds a small script which will always start/stop/restart simulavr together with klipper

restarting klipper often resulted in a failed mcu reset error, this is an attempt to fix that
This commit is contained in:
th33xitus 2022-02-10 19:56:22 +01:00
parent 859f3968e4
commit 5275832638
3 changed files with 9 additions and 1 deletions

View File

@ -46,6 +46,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
### copy all required files ### copy all required files
COPY simulavr.config /usr/src COPY simulavr.config /usr/src
COPY supervisord.conf /etc/supervisor/supervisord.conf COPY supervisord.conf /etc/supervisor/supervisord.conf
COPY service_control.sh /bin/service_control
COPY start.sh /bin/start COPY start.sh /bin/start
### make entrypoint executable ### make entrypoint executable

View File

@ -0,0 +1,7 @@
#!/bin/sh
if [ "$2" = "klipper" ]; then
sudo /usr/bin/supervisorctl "$1" simulavr "$2"
else
sudo /usr/bin/supervisorctl "$1" "$2"
fi

View File

@ -79,7 +79,7 @@ setup_simulavr
build_simulavr build_simulavr
sudo -S rm /bin/systemctl sudo -S rm /bin/systemctl
sudo -S ln -s /usr/bin/supervisorctl /bin/systemctl sudo -S ln -s /bin/service_control /bin/systemctl
cd ~ && echo "Everything is ready ... Starting ..." cd ~ && echo "Everything is ready ... Starting ..."
/usr/bin/supervisord /usr/bin/supervisord