postsrsd
This commit is contained in:
parent
c06dc5a527
commit
7484c64be2
3 changed files with 33 additions and 0 deletions
10
Dockerfile
10
Dockerfile
|
@ -1,2 +1,12 @@
|
||||||
FROM sutty/monit:latest
|
FROM sutty/monit:latest
|
||||||
MAINTAINER "f <f@sutty.nl>"
|
MAINTAINER "f <f@sutty.nl>"
|
||||||
|
|
||||||
|
ENV SRS_DOMAIN sutty.nl
|
||||||
|
ENV SRS_SECRET /etc/postsrsd.secret
|
||||||
|
|
||||||
|
RUN apk add --no-cache postsrsd
|
||||||
|
COPY ./monit.conf /etc/monit.d/postsrsd.conf
|
||||||
|
COPY ./postsrsd.sh /usr/local/bin/postsrsd
|
||||||
|
|
||||||
|
EXPOSE 10001
|
||||||
|
EXPOSE 10002
|
||||||
|
|
6
monit.conf
Normal file
6
monit.conf
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
check process postsrsd with pidfile /tmp/postsrsd.pid
|
||||||
|
start program = "/usr/local/bin/postsrsd"
|
||||||
|
stop program = "/bin/sh -c 'cat /tmp/postsrsd.pid | xargs -r kill'"
|
||||||
|
|
||||||
|
if failed port 10001 for 3 cycles then restart
|
||||||
|
if failed port 10002 for 3 cycles then restart
|
17
postsrsd.sh
Executable file
17
postsrsd.sh
Executable file
|
@ -0,0 +1,17 @@
|
||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
export SRS_PID_FILE=/tmp/postsrsd.pid
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
stop)
|
||||||
|
test -f "${SRS_PID_FILE}" && cat /tmp/postsrsd.pid | xargs -r kill
|
||||||
|
exit $?
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
test -n "${SRS_DOMAIN}"
|
||||||
|
test -n "${SRS_SECRET}"
|
||||||
|
test -f "${SRS_SECRET}" || dd if=/dev/urandom bs=18 count=1 status=none | base64 > "${SRS_SECRET}"
|
||||||
|
|
||||||
|
/usr/sbin/postsrsd -e -D -l 0.0.0.0 -u postsrsd -4
|
Loading…
Reference in a new issue