feat: suttyns
This commit is contained in:
parent
3977a828e9
commit
f2006e1934
3 changed files with 28 additions and 1 deletions
|
@ -3,9 +3,11 @@ ARG BASE_IMAGE=gitea.nulo.in/sutty/monit
|
|||
FROM ${BASE_IMAGE}:${ALPINE_VERSION}
|
||||
MAINTAINER "f <f@sutty.nl>"
|
||||
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 ./suttynsd.sh /usr/local/bin/suttynsd
|
||||
|
||||
EXPOSE 53
|
||||
EXPOSE 53/udp
|
||||
|
|
|
@ -4,3 +4,10 @@ check process knot with pidfile /tmp/knot.pid
|
|||
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 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
18
suttynsd.sh
Executable 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
|
Loading…
Reference in a new issue