Skip to content

Commit

Permalink
Fix watcherd startup behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
cytopia committed Jun 3, 2018
1 parent 2c6d28f commit 2c36287
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ ENV RUN_DEPS \
ENV MY_USER=daemon
ENV MY_GROUP=daemon
ENV HTTPD_START="httpd-foreground"
ENV HTTPD_RELOAD="/usr/local/apache2/bin/httpd -k restart"
ENV HTTPD_RELOAD="/usr/local/apache2/bin/httpd -k stop"


###
Expand Down
9 changes: 7 additions & 2 deletions data/docker-entrypoint.d/10-supervisord.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@ supervisord_create() {
echo
echo "[program:httpd]"
echo "command=${httpd_command}"
echo "autostart=false"
echo "autorestart=false"
echo "priority=1"
echo "autostart=true"
echo "startretries=100"
echo "startsecs=1"
echo "autorestart=true"
echo "stdout_logfile=/dev/stdout"
echo "stdout_logfile_maxbytes=0"
echo "stderr_logfile=/dev/stderr"
Expand All @@ -40,6 +43,8 @@ supervisord_create() {
echo
echo "[program:watcherd]"
echo "command=${watcherd_command}"
echo "priority=999"
echo "autostart=true"
echo "autorestart=false"
echo "stdout_logfile=/dev/stdout"
echo "stdout_logfile_maxbytes=0"
Expand Down
6 changes: 5 additions & 1 deletion data/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ CA_CRT=/ca/devilbox-ca.crt
CONFIG_DIR="/docker-entrypoint.d"


# Wait this many seconds to start watcherd after httpd has been started
WATCHERD_STARTUP_DELAY="3"


###
### Source libs
###
Expand Down Expand Up @@ -224,7 +228,7 @@ if [ "${MASS_VHOST_ENABLE}" -eq "1" ]; then

supervisord_create \
"${HTTPD_START}" \
"watcherd -v -p /shared/httpd -a \"${watcherd_add}\" -d \"${watcherd_del}\" -t \"${watcherd_tri}\"" \
"bash -c 'sleep ${WATCHERD_STARTUP_DELAY} && exec watcherd -v -p /shared/httpd -a \"${watcherd_add}\" -d \"${watcherd_del}\" -t \"${watcherd_tri}\"'" \
"/etc/supervisord.conf"

log "info" "Starting supervisord: $(supervisord -v)" "${DEBUG_LEVEL}"
Expand Down

0 comments on commit 2c36287

Please sign in to comment.