Merge pull request #1 from tobbenb/fixes

Fixes
This commit is contained in:
sparklyballs 2016-11-14 16:04:34 +00:00 committed by GitHub
commit 99394dbea4
5 changed files with 14 additions and 9 deletions

View File

@ -6,6 +6,9 @@ ARG BUILD_DATE
ARG VERSION
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
# copy local files
COPY root/ /
# install build time dependencies
RUN \
apk add --no-cache --virtual=build-dependencies \
@ -39,6 +42,9 @@ RUN \
tar xf /tmp/ddclient.tar.bz2 -C \
/tmp/ddclient --strip-components=1 && \
cp /tmp/ddclient/ddclient /usr/bin/ && \
cp /defaults/ddclient.conf /ddclient.conf && \
chmod 600 /ddclient.conf && \
chown ddclient:ddclient /ddclient.conf && \
# add runtime folders and change permissions
mkdir -p /var/cache/ddclient && \
@ -53,10 +59,8 @@ RUN \
build-dependencies && \
rm -rf \
/config/.cpanm \
/root/.cpanm \
/tmp/*
# copy local files
COPY root/ /
# ports and volumes
VOLUME /config

View File

@ -20,8 +20,8 @@
######################################################################
daemon=300 # check every 300 seconds
syslog=yes # log update msgs to syslog
mail=root # mail all msgs to root
mail-failure=root # mail failed update msgs to root
#mail=root # mail all msgs to root
#mail-failure=root # mail failed update msgs to root
pid=/var/run/ddclient/ddclient.pid # record PID in file.
ssl=yes # use ssl-support. Works with
# ssl-library

View File

@ -1,6 +1,5 @@
#!/usr/bin/with-contenv bash
# copy default config if not present in /config
[[ ! -e /config/ddclient.conf ]] && \
cp /defaults/ddclient.conf /config

View File

@ -1,3 +1,3 @@
#!/usr/bin/with-contenv bash
exec \
s6-setuidgid ddclient /usr/bin/ddclient -foreground -file /config/ddclient.conf
s6-setuidgid ddclient /usr/bin/ddclient -foreground -file /ddclient.conf

View File

@ -1,8 +1,10 @@
#!/usr/bin/with-contenv bash
# starting inotify to watch /config/ddclient.conf and restart ddclient if changed.
while inotifywait -e modify /config/ddclient.conf; do
# kill "$(pgrep ddclient)"
while inotifywait -e close_write /config/ddclient.conf; do
cp /config/ddclient.conf /ddclient.conf
chmod 600 /ddclient.conf
chown ddclient:ddclient /ddclient.conf
kill "$(cat /var/run/ddclient/ddclient.pid)"
echo "ddclient have been restarted"
done