Add snowmix wrapper to handle graceful shutdown
parent
ba2f73cf6c
commit
851a2d37b1
|
@ -36,4 +36,4 @@ RUN mkdir $GOPATH && cd /tools/de-ip-hdmi && go get -d . && go build . && chmod
|
|||
RUN sed -i -e 's_NC\=.*_NC="nc -q1"_' /usr/local/lib/Snowmix-0.5.1/scripts/snowmix-settings
|
||||
|
||||
USER snowmix
|
||||
CMD snowmix
|
||||
CMD [ "/tools/run-snowmix" ]
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Just a simple wrapper around snowmix, so that SIGTERM will make it shutdown
|
||||
# gracefully
|
||||
|
||||
term_handler() {
|
||||
echo 'quit' | nc -q1 127.0.0.1 9999
|
||||
}
|
||||
|
||||
trap 'term_handler' SIGTERM
|
||||
|
||||
snowmix & wait ${!}
|
||||
exit $?
|
Loading…
Reference in New Issue