Compare commits
2 Commits
283d56ccfd
...
2d77edd41a
Author | SHA1 | Date |
---|---|---|
Siwat Sirichai | 2d77edd41a | |
Siwat Sirichai | 2d74c37e3c |
|
@ -65,3 +65,8 @@ RUN mkdir -p /opt/printstack/data/moonraker
|
||||||
RUN moonraker/scripts/install-moonraker.sh -d /opt/printstack/data/moonraker -z
|
RUN moonraker/scripts/install-moonraker.sh -d /opt/printstack/data/moonraker -z
|
||||||
|
|
||||||
##########################
|
##########################
|
||||||
|
# Daemons #
|
||||||
|
##########################
|
||||||
|
COPY entrypoint.sh /opt/printstack/entrypoint.sh
|
||||||
|
RUN chmod +x /opt/printstack/entrypoint.sh
|
||||||
|
ENTRYPOINT ["/opt/printstack/entrypoint.sh"]
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Start the processes
|
||||||
|
/opt/printstack/klippy-env/bin/python /opt/printstack/klipper/klippy/klippy.py -a /tmp/klippy_ud /opt/printstack/data/klipper/printer.cfg &
|
||||||
|
KLIPPY_PID=$!
|
||||||
|
|
||||||
|
/opt/printstack/moonraker-env/bin/python /opt/printstack/moonraker/moonraker/moonraker.py -c /opt/printstack/data/moonraker/config/moonraker.conf &
|
||||||
|
MOONRAKER_PID=$!
|
||||||
|
|
||||||
|
# Function to stop both processes
|
||||||
|
stop_processes() {
|
||||||
|
kill $KLIPPY_PID
|
||||||
|
kill $MOONRAKER_PID
|
||||||
|
sleep 30
|
||||||
|
kill -0 $KLIPPY_PID 2>/dev/null && kill -9 $KLIPPY_PID
|
||||||
|
kill -0 $MOONRAKER_PID 2>/dev/null && kill -9 $MOONRAKER_PID
|
||||||
|
}
|
||||||
|
|
||||||
|
# Catch signals
|
||||||
|
trap stop_processes SIGTERM SIGINT
|
||||||
|
|
||||||
|
# Wait for both processes to finish
|
||||||
|
wait $KLIPPY_PID
|
||||||
|
wait $MOONRAKER_PID
|
Loading…
Reference in New Issue