daemonize
This commit is contained in:
parent
6c766bcfef
commit
ab37995bd0
4 changed files with 12 additions and 12 deletions
|
@ -9,9 +9,8 @@ RUN tar x -Of syncthing-linux-amd64-v${VERSION}.tar.gz syncthing-linux-amd64-v${
|
||||||
RUN chmod +x /usr/local/bin/syncthing
|
RUN chmod +x /usr/local/bin/syncthing
|
||||||
RUN strip --strip-all /usr/local/bin/syncthing
|
RUN strip --strip-all /usr/local/bin/syncthing
|
||||||
|
|
||||||
COPY ./syncthing_stop.sh /usr/local/bin/syncthing_stop
|
|
||||||
COPY ./syncthing_start.sh /usr/local/bin/syncthing_start
|
COPY ./syncthing_start.sh /usr/local/bin/syncthing_start
|
||||||
RUN chmod 755 /usr/local/bin/syncthing_stop /usr/local/bin/syncthing_start
|
RUN chmod 755 /usr/local/bin/syncthing_start
|
||||||
|
|
||||||
RUN echo /home/builder/packages/home > /etc/apk/repositories
|
RUN echo /home/builder/packages/home > /etc/apk/repositories
|
||||||
RUN apk add --no-cache daemonize
|
RUN apk add --no-cache daemonize
|
||||||
|
@ -19,7 +18,6 @@ RUN apk add --no-cache daemonize
|
||||||
FROM sutty/monit:latest
|
FROM sutty/monit:latest
|
||||||
|
|
||||||
COPY --from=build /usr/local/bin/syncthing /usr/local/bin/syncthing
|
COPY --from=build /usr/local/bin/syncthing /usr/local/bin/syncthing
|
||||||
COPY --from=build /usr/local/bin/syncthing_stop /usr/local/bin/syncthing_stop
|
|
||||||
COPY --from=build /usr/local/bin/syncthing_start /usr/local/bin/syncthing_start
|
COPY --from=build /usr/local/bin/syncthing_start /usr/local/bin/syncthing_start
|
||||||
COPY --from=build /usr/sbin/daemonize /usr/sbin/daemonize
|
COPY --from=build /usr/sbin/daemonize /usr/sbin/daemonize
|
||||||
COPY ./monit.conf /etc/monit.d/syncthing.conf
|
COPY ./monit.conf /etc/monit.d/syncthing.conf
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
check process syncthing with pidfile /tmp/syncthing.pid
|
check process syncthing with pidfile /tmp/syncthing.pid
|
||||||
start program = "/usr/local/bin/syncthing_start" as uid "syncthing"
|
start program = "/usr/local/bin/syncthing_start"
|
||||||
stop program = "/usr/local/bin/syncthing_stop"
|
stop program = "/bin/sh -c 'cat /tmp/syncthing.pid | xargs kill'"
|
||||||
|
|
|
@ -1,6 +1,11 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
daemonize -p /tmp/syncthing.pid -l /tmp/syncthing.pid \
|
pid=/tmp/syncthing.pid
|
||||||
/usr/local/bin/syncthing -no-browser \
|
dir=/home/syncthing
|
||||||
-logfile="/home/syncthing/syncthing.log" \
|
log=/dev/log
|
||||||
-gui-address="http://0.0.0.0:8443"
|
|
||||||
|
rm -f ${pid}
|
||||||
|
|
||||||
|
daemonize -p ${pid} -l ${pid} -u syncthing -c ${dir} \
|
||||||
|
-o ${log} -a -e ${log} \
|
||||||
|
/usr/local/bin/syncthing -no-browser -gui-address='http://0.0.0.0:8443'
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
ps aux | grep syncthing | tr -s " " | cut -d " " -f 2 | xargs kill
|
|
Loading…
Reference in a new issue