feat: suttyns
Some checks failed
ci/woodpecker/push/woodpecker/2 Pipeline failed
ci/woodpecker/push/woodpecker/1 Pipeline failed

This commit is contained in:
f 2023-11-23 17:46:50 -03:00
parent 3977a828e9
commit f2006e1934
No known key found for this signature in database
3 changed files with 28 additions and 1 deletions

View file

@ -3,9 +3,11 @@ ARG BASE_IMAGE=gitea.nulo.in/sutty/monit
FROM ${BASE_IMAGE}:${ALPINE_VERSION} FROM ${BASE_IMAGE}:${ALPINE_VERSION}
MAINTAINER "f <f@sutty.nl>" MAINTAINER "f <f@sutty.nl>"
ARG KNOT_VERSION=3.1.8 ARG KNOT_VERSION=3.1.8
ENV SUTTYNS_FLAGS
RUN apk add --no-cache knot~${KNOT_VERSION} RUN apk add --no-cache knot~${KNOT_VERSION} suttyns
COPY ./monit.conf /etc/monit.d/knot.conf COPY ./monit.conf /etc/monit.d/knot.conf
COPY ./suttynsd.sh /usr/local/bin/suttynsd
EXPOSE 53 EXPOSE 53
EXPOSE 53/udp EXPOSE 53/udp

View file

@ -4,3 +4,10 @@ check process knot with pidfile /tmp/knot.pid
if 5 restarts within 8 cycles then alert if 5 restarts within 8 cycles then alert
if failed port 53 type udp protocol dns for 3 times within 5 cycles then restart if failed port 53 type udp protocol dns for 3 times within 5 cycles then restart
if failed port 53 type tcp protocol dns for 3 times within 5 cycles then restart if failed port 53 type tcp protocol dns for 3 times within 5 cycles then restart
check process suttyns with pidfile /tmp/suttyns.pid
start program = "/usr/local/bin/suttynsd start"
stop program = "/usr/local/bin/suttynsd stop"
if 5 restarts within 8 cycles then alert
if failed port 53535 type udp protocol dns for 3 times within 5 cycles then restart
if failed port 53535 type tcp protocol dns for 3 times within 5 cycles then restart

18
suttynsd.sh Executable file
View file

@ -0,0 +1,18 @@
#!/bin/sh
pid=/tmp/suttyns.pid
case $1 in
start)
test -f $pid && exit 0
daemonize -p $pid -u nobody /usr/local/bin/syslogize /usr/bin/suttyns $SUTTYNS_FLAGS
;;
stop)
test -f $pid || exit 0
cat $pid | xargs kill
rm $pid
;;
esac