diff options
author | Andrei Belov <defan@nginx.com> | 2019-10-03 17:46:28 +0300 |
---|---|---|
committer | Andrei Belov <defan@nginx.com> | 2019-10-03 17:46:28 +0300 |
commit | 3dd3f861f4c3aa320aa137802f033f8f1fc7dc41 (patch) | |
tree | 357577c560920eb0f5837b7d073999f5c7a1a2cd /pkg | |
parent | 9de7aea721245cda9f079a2b29d8efaf99c440fd (diff) | |
parent | 59db9a3887211fccdaec04b7952ad0140090de22 (diff) | |
download | unit-3dd3f861f4c3aa320aa137802f033f8f1fc7dc41.tar.gz unit-3dd3f861f4c3aa320aa137802f033f8f1fc7dc41.tar.bz2 |
Merged with the default branch.
Diffstat (limited to '')
49 files changed, 175 insertions, 47 deletions
diff --git a/pkg/deb/Makefile b/pkg/deb/Makefile index ac7cc679..952408cd 100644 --- a/pkg/deb/Makefile +++ b/pkg/deb/Makefile @@ -2,7 +2,7 @@ include ../../version -DEFAULT_RELEASE := 2 +DEFAULT_RELEASE := 1 VERSION ?= $(NXT_VERSION) RELEASE ?= $(DEFAULT_RELEASE) diff --git a/pkg/deb/Makefile.go b/pkg/deb/Makefile.go index 549a2b3b..3399f5ca 100644 --- a/pkg/deb/Makefile.go +++ b/pkg/deb/Makefile.go @@ -4,7 +4,7 @@ MODULE_SUFFIX_go= go MODULE_SUMMARY_go= Go module for NGINX Unit MODULE_VERSION_go= $(VERSION) -MODULE_RELEASE_go= 2 +MODULE_RELEASE_go= 1 MODULE_CONFARGS_go= go --go-path=/usr/share/gocode MODULE_MAKEARGS_go= go diff --git a/pkg/deb/Makefile.go110 b/pkg/deb/Makefile.go110 index b678e278..0e956d9f 100644 --- a/pkg/deb/Makefile.go110 +++ b/pkg/deb/Makefile.go110 @@ -4,7 +4,7 @@ MODULE_SUFFIX_go110= go1.10 MODULE_SUMMARY_go110= Go 1.10 module for NGINX Unit MODULE_VERSION_go110= $(VERSION) -MODULE_RELEASE_go110= 2 +MODULE_RELEASE_go110= 1 MODULE_CONFARGS_go110= go --go=/usr/lib/go-1.10/bin/go --go-path=/usr/share/gocode MODULE_MAKEARGS_go110= /usr/lib/go-1.10/bin/go diff --git a/pkg/deb/Makefile.go111 b/pkg/deb/Makefile.go111 index 4af99ac1..f8ed5ae8 100644 --- a/pkg/deb/Makefile.go111 +++ b/pkg/deb/Makefile.go111 @@ -4,7 +4,7 @@ MODULE_SUFFIX_go111= go1.11 MODULE_SUMMARY_go111= Go 1.11 module for NGINX Unit MODULE_VERSION_go111= $(VERSION) -MODULE_RELEASE_go111= 2 +MODULE_RELEASE_go111= 1 MODULE_CONFARGS_go111= go --go=/usr/lib/go-1.11/bin/go --go-path=/usr/share/gocode MODULE_MAKEARGS_go111= /usr/lib/go-1.11/bin/go diff --git a/pkg/deb/Makefile.go17 b/pkg/deb/Makefile.go17 index a2032ce9..d014edd1 100644 --- a/pkg/deb/Makefile.go17 +++ b/pkg/deb/Makefile.go17 @@ -4,7 +4,7 @@ MODULE_SUFFIX_go17= go1.7 MODULE_SUMMARY_go17= Go 1.7 module for NGINX Unit MODULE_VERSION_go17= $(VERSION) -MODULE_RELEASE_go17= 2 +MODULE_RELEASE_go17= 1 MODULE_CONFARGS_go17= go --go=/usr/lib/go-1.7/bin/go --go-path=/usr/share/gocode MODULE_MAKEARGS_go17= /usr/lib/go-1.7/bin/go diff --git a/pkg/deb/Makefile.go18 b/pkg/deb/Makefile.go18 index 601f18c9..597f4804 100644 --- a/pkg/deb/Makefile.go18 +++ b/pkg/deb/Makefile.go18 @@ -4,7 +4,7 @@ MODULE_SUFFIX_go18= go1.8 MODULE_SUMMARY_go18= Go 1.8 module for NGINX Unit MODULE_VERSION_go18= $(VERSION) -MODULE_RELEASE_go18= 2 +MODULE_RELEASE_go18= 1 MODULE_CONFARGS_go18= go --go=/usr/lib/go-1.8/bin/go --go-path=/usr/share/gocode MODULE_MAKEARGS_go18= /usr/lib/go-1.8/bin/go diff --git a/pkg/deb/Makefile.go19 b/pkg/deb/Makefile.go19 index 7ca8ea1a..60d4b239 100644 --- a/pkg/deb/Makefile.go19 +++ b/pkg/deb/Makefile.go19 @@ -4,7 +4,7 @@ MODULE_SUFFIX_go19= go1.9 MODULE_SUMMARY_go19= Go 1.9 module for NGINX Unit MODULE_VERSION_go19= $(VERSION) -MODULE_RELEASE_go19= 2 +MODULE_RELEASE_go19= 1 MODULE_CONFARGS_go19= go --go=/usr/lib/go-1.9/bin/go --go-path=/usr/share/gocode MODULE_MAKEARGS_go19= /usr/lib/go-1.9/bin/go diff --git a/pkg/deb/Makefile.jsc-common b/pkg/deb/Makefile.jsc-common index 3f34aece..30f777fd 100644 --- a/pkg/deb/Makefile.jsc-common +++ b/pkg/deb/Makefile.jsc-common @@ -4,7 +4,7 @@ MODULE_SUFFIX_jsc_common= jsc-common MODULE_SUMMARY_jsc_common= Java shared packages for NGINX Unit MODULE_VERSION_jsc_common= $(VERSION) -MODULE_RELEASE_jsc_common= 2 +MODULE_RELEASE_jsc_common= 1 ifneq (,$(findstring $(CODENAME),disco buster)) JAVA_MINVERSION= 11 diff --git a/pkg/deb/Makefile.jsc10 b/pkg/deb/Makefile.jsc10 index df59abb8..43ded86b 100644 --- a/pkg/deb/Makefile.jsc10 +++ b/pkg/deb/Makefile.jsc10 @@ -4,7 +4,7 @@ MODULE_SUFFIX_jsc10= jsc10 MODULE_SUMMARY_jsc10= Java 10 module for NGINX Unit MODULE_VERSION_jsc10= $(VERSION) -MODULE_RELEASE_jsc10= 2 +MODULE_RELEASE_jsc10= 1 MODULE_CONFARGS_jsc10= java --module=java10 --home=/usr/lib/jvm/java-11-openjdk-$$\(DEB_HOST_ARCH\) --jars=/usr/share/unit-jsc-common/ MODULE_MAKEARGS_jsc10= java10 diff --git a/pkg/deb/Makefile.jsc11 b/pkg/deb/Makefile.jsc11 index fcf17bc9..40f60f17 100644 --- a/pkg/deb/Makefile.jsc11 +++ b/pkg/deb/Makefile.jsc11 @@ -4,7 +4,7 @@ MODULE_SUFFIX_jsc11= jsc11 MODULE_SUMMARY_jsc11= Java 11 module for NGINX Unit MODULE_VERSION_jsc11= $(VERSION) -MODULE_RELEASE_jsc11= 2 +MODULE_RELEASE_jsc11= 1 MODULE_CONFARGS_jsc11= java --module=java11 --home=/usr/lib/jvm/java-11-openjdk-$$\(DEB_HOST_ARCH\) --jars=/usr/share/unit-jsc-common/ MODULE_MAKEARGS_jsc11= java11 diff --git a/pkg/deb/Makefile.jsc8 b/pkg/deb/Makefile.jsc8 index a98a4a3a..d7eed96b 100644 --- a/pkg/deb/Makefile.jsc8 +++ b/pkg/deb/Makefile.jsc8 @@ -4,7 +4,7 @@ MODULE_SUFFIX_jsc8= jsc8 MODULE_SUMMARY_jsc8= Java 8 module for NGINX Unit MODULE_VERSION_jsc8= $(VERSION) -MODULE_RELEASE_jsc8= 2 +MODULE_RELEASE_jsc8= 1 MODULE_CONFARGS_jsc8= java --module=java8 --home=/usr/lib/jvm/java-8-openjdk-$$\(DEB_HOST_ARCH\) --jars=/usr/share/unit-jsc-common/ MODULE_MAKEARGS_jsc8= java8 diff --git a/pkg/deb/Makefile.perl b/pkg/deb/Makefile.perl index 8f47a7d3..7ac3ea11 100644 --- a/pkg/deb/Makefile.perl +++ b/pkg/deb/Makefile.perl @@ -4,7 +4,7 @@ MODULE_SUFFIX_perl= perl MODULE_SUMMARY_perl= Perl module for NGINX Unit MODULE_VERSION_perl= $(VERSION) -MODULE_RELEASE_perl= 2 +MODULE_RELEASE_perl= 1 MODULE_CONFARGS_perl= perl MODULE_MAKEARGS_perl= perl diff --git a/pkg/deb/Makefile.php b/pkg/deb/Makefile.php index d46a09c9..d05d5ad5 100644 --- a/pkg/deb/Makefile.php +++ b/pkg/deb/Makefile.php @@ -4,7 +4,7 @@ MODULE_SUFFIX_php= php MODULE_SUMMARY_php= PHP module for NGINX Unit MODULE_VERSION_php= $(VERSION) -MODULE_RELEASE_php= 2 +MODULE_RELEASE_php= 1 MODULE_CONFARGS_php= php MODULE_MAKEARGS_php= php diff --git a/pkg/deb/Makefile.python b/pkg/deb/Makefile.python index 84d2bb64..9bf02bac 100644 --- a/pkg/deb/Makefile.python +++ b/pkg/deb/Makefile.python @@ -4,7 +4,7 @@ MODULE_SUFFIX_python= python MODULE_SUMMARY_python= Python module for NGINX Unit MODULE_VERSION_python= $(VERSION) -MODULE_RELEASE_python= 2 +MODULE_RELEASE_python= 1 MODULE_CONFARGS_python= python MODULE_MAKEARGS_python= python diff --git a/pkg/deb/Makefile.python27 b/pkg/deb/Makefile.python27 index 7779b7b3..cf4f49d9 100644 --- a/pkg/deb/Makefile.python27 +++ b/pkg/deb/Makefile.python27 @@ -4,7 +4,7 @@ MODULE_SUFFIX_python27= python2.7 MODULE_SUMMARY_python27= Python 2.7 module for NGINX Unit MODULE_VERSION_python27= $(VERSION) -MODULE_RELEASE_python27= 2 +MODULE_RELEASE_python27= 1 MODULE_CONFARGS_python27= python --config=python2.7-config MODULE_MAKEARGS_python27= python2.7 diff --git a/pkg/deb/Makefile.python34 b/pkg/deb/Makefile.python34 index 71ab873d..03c496bd 100644 --- a/pkg/deb/Makefile.python34 +++ b/pkg/deb/Makefile.python34 @@ -4,7 +4,7 @@ MODULE_SUFFIX_python34= python3.4 MODULE_SUMMARY_python34= Python 3.4 module for NGINX Unit MODULE_VERSION_python34= $(VERSION) -MODULE_RELEASE_python34= 2 +MODULE_RELEASE_python34= 1 MODULE_CONFARGS_python34= python --config=python3.4-config MODULE_MAKEARGS_python34= python3.4 diff --git a/pkg/deb/Makefile.python35 b/pkg/deb/Makefile.python35 index 9f0b705c..514a4bf6 100644 --- a/pkg/deb/Makefile.python35 +++ b/pkg/deb/Makefile.python35 @@ -4,7 +4,7 @@ MODULE_SUFFIX_python35= python3.5 MODULE_SUMMARY_python35= Python 3.5 module for NGINX Unit MODULE_VERSION_python35= $(VERSION) -MODULE_RELEASE_python35= 2 +MODULE_RELEASE_python35= 1 MODULE_CONFARGS_python35= python --config=python3.5-config MODULE_MAKEARGS_python35= python3.5 diff --git a/pkg/deb/Makefile.python36 b/pkg/deb/Makefile.python36 index 93f12bd8..4fd898c6 100644 --- a/pkg/deb/Makefile.python36 +++ b/pkg/deb/Makefile.python36 @@ -4,7 +4,7 @@ MODULE_SUFFIX_python36= python3.6 MODULE_SUMMARY_python36= Python 3.6 module for NGINX Unit MODULE_VERSION_python36= $(VERSION) -MODULE_RELEASE_python36= 2 +MODULE_RELEASE_python36= 1 MODULE_CONFARGS_python36= python --config=python3.6-config MODULE_MAKEARGS_python36= python3.6 diff --git a/pkg/deb/Makefile.python37 b/pkg/deb/Makefile.python37 index 652986f3..54dd8c4c 100644 --- a/pkg/deb/Makefile.python37 +++ b/pkg/deb/Makefile.python37 @@ -4,7 +4,7 @@ MODULE_SUFFIX_python37= python3.7 MODULE_SUMMARY_python37= Python 3.7 module for NGINX Unit MODULE_VERSION_python37= $(VERSION) -MODULE_RELEASE_python37= 2 +MODULE_RELEASE_python37= 1 MODULE_CONFARGS_python37= python --config=python3.7-config MODULE_MAKEARGS_python37= python3.7 diff --git a/pkg/deb/Makefile.ruby b/pkg/deb/Makefile.ruby index 039f1ce4..dd85cd38 100644 --- a/pkg/deb/Makefile.ruby +++ b/pkg/deb/Makefile.ruby @@ -4,7 +4,7 @@ MODULE_SUFFIX_ruby= ruby MODULE_SUMMARY_ruby= Ruby module for NGINX Unit MODULE_VERSION_ruby= $(VERSION) -MODULE_RELEASE_ruby= 2 +MODULE_RELEASE_ruby= 1 MODULE_CONFARGS_ruby= ruby MODULE_MAKEARGS_ruby= ruby diff --git a/pkg/deb/debian/unit.init b/pkg/deb/debian/unit.init index 2f573f99..900e97fd 100644 --- a/pkg/deb/debian/unit.init +++ b/pkg/deb/debian/unit.init @@ -13,11 +13,9 @@ ### END INIT INFO PATH=/sbin:/bin:/usr/sbin:/usr/bin DAEMON=/usr/sbin/unitd -NAME=unitd +NAME=unit DESC=unitd -[ -r /etc/default/${NAME} ] && . /etc/default/${NAME} - #includes lsb functions . /lib/lsb/init-functions diff --git a/pkg/deb/debian/unit.logrotate b/pkg/deb/debian/unit.logrotate new file mode 100644 index 00000000..416947ca --- /dev/null +++ b/pkg/deb/debian/unit.logrotate @@ -0,0 +1,15 @@ +/var/log/unit.log { + daily + missingok + rotate 7 + compress + delaycompress + nocreate + notifempty + su root root + postrotate + if [ -f /var/run/unit.pid ]; then + /bin/kill -SIGUSR1 `cat /var/run/unit.pid` + fi + endscript +} diff --git a/pkg/docker/Dockerfile.full b/pkg/docker/Dockerfile.full index ae700b32..c6646fda 100644 --- a/pkg/docker/Dockerfile.full +++ b/pkg/docker/Dockerfile.full @@ -2,7 +2,7 @@ FROM debian:stretch-slim LABEL maintainer="NGINX Docker Maintainers <docker-maint@nginx.com>" -ENV UNIT_VERSION 1.11.0-2~stretch +ENV UNIT_VERSION 1.12.0-1~stretch RUN set -x \ && apt-get update \ @@ -86,4 +86,8 @@ RUN ln -sf /dev/stdout /var/log/unit.log STOPSIGNAL SIGTERM +COPY docker-entrypoint.sh /usr/local/bin/ +RUN mkdir /docker-entrypoint.d/ +ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] + CMD ["unitd", "--no-daemon", "--control", "unix:/var/run/control.unit.sock"] diff --git a/pkg/docker/Dockerfile.go1.7-dev b/pkg/docker/Dockerfile.go1.7-dev index 12b80daa..9b57d3ec 100644 --- a/pkg/docker/Dockerfile.go1.7-dev +++ b/pkg/docker/Dockerfile.go1.7-dev @@ -2,7 +2,7 @@ FROM debian:stretch-slim LABEL maintainer="NGINX Docker Maintainers <docker-maint@nginx.com>" -ENV UNIT_VERSION 1.11.0-2~stretch +ENV UNIT_VERSION 1.12.0-1~stretch RUN set -x \ && apt-get update \ @@ -86,4 +86,8 @@ RUN ln -sf /dev/stdout /var/log/unit.log STOPSIGNAL SIGTERM +COPY docker-entrypoint.sh /usr/local/bin/ +RUN mkdir /docker-entrypoint.d/ +ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] + CMD ["unitd", "--no-daemon", "--control", "unix:/var/run/control.unit.sock"] diff --git a/pkg/docker/Dockerfile.go1.8-dev b/pkg/docker/Dockerfile.go1.8-dev index 58b36458..5f650aae 100644 --- a/pkg/docker/Dockerfile.go1.8-dev +++ b/pkg/docker/Dockerfile.go1.8-dev @@ -2,7 +2,7 @@ FROM debian:stretch-slim LABEL maintainer="NGINX Docker Maintainers <docker-maint@nginx.com>" -ENV UNIT_VERSION 1.11.0-2~stretch +ENV UNIT_VERSION 1.12.0-1~stretch RUN set -x \ && apt-get update \ @@ -86,4 +86,8 @@ RUN ln -sf /dev/stdout /var/log/unit.log STOPSIGNAL SIGTERM +COPY docker-entrypoint.sh /usr/local/bin/ +RUN mkdir /docker-entrypoint.d/ +ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] + CMD ["unitd", "--no-daemon", "--control", "unix:/var/run/control.unit.sock"] diff --git a/pkg/docker/Dockerfile.minimal b/pkg/docker/Dockerfile.minimal index 587ef3f1..427a3ada 100644 --- a/pkg/docker/Dockerfile.minimal +++ b/pkg/docker/Dockerfile.minimal @@ -2,7 +2,7 @@ FROM debian:stretch-slim LABEL maintainer="NGINX Docker Maintainers <docker-maint@nginx.com>" -ENV UNIT_VERSION 1.11.0-2~stretch +ENV UNIT_VERSION 1.12.0-1~stretch RUN set -x \ && apt-get update \ @@ -86,4 +86,8 @@ RUN ln -sf /dev/stdout /var/log/unit.log STOPSIGNAL SIGTERM +COPY docker-entrypoint.sh /usr/local/bin/ +RUN mkdir /docker-entrypoint.d/ +ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] + CMD ["unitd", "--no-daemon", "--control", "unix:/var/run/control.unit.sock"] diff --git a/pkg/docker/Dockerfile.perl5.24 b/pkg/docker/Dockerfile.perl5.24 index fb77a03a..7e51adcf 100644 --- a/pkg/docker/Dockerfile.perl5.24 +++ b/pkg/docker/Dockerfile.perl5.24 @@ -2,7 +2,7 @@ FROM debian:stretch-slim LABEL maintainer="NGINX Docker Maintainers <docker-maint@nginx.com>" -ENV UNIT_VERSION 1.11.0-2~stretch +ENV UNIT_VERSION 1.12.0-1~stretch RUN set -x \ && apt-get update \ @@ -86,4 +86,8 @@ RUN ln -sf /dev/stdout /var/log/unit.log STOPSIGNAL SIGTERM +COPY docker-entrypoint.sh /usr/local/bin/ +RUN mkdir /docker-entrypoint.d/ +ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] + CMD ["unitd", "--no-daemon", "--control", "unix:/var/run/control.unit.sock"] diff --git a/pkg/docker/Dockerfile.php7.0 b/pkg/docker/Dockerfile.php7.0 index 2654fe04..9615e041 100644 --- a/pkg/docker/Dockerfile.php7.0 +++ b/pkg/docker/Dockerfile.php7.0 @@ -2,7 +2,7 @@ FROM debian:stretch-slim LABEL maintainer="NGINX Docker Maintainers <docker-maint@nginx.com>" -ENV UNIT_VERSION 1.11.0-2~stretch +ENV UNIT_VERSION 1.12.0-1~stretch RUN set -x \ && apt-get update \ @@ -86,4 +86,8 @@ RUN ln -sf /dev/stdout /var/log/unit.log STOPSIGNAL SIGTERM +COPY docker-entrypoint.sh /usr/local/bin/ +RUN mkdir /docker-entrypoint.d/ +ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] + CMD ["unitd", "--no-daemon", "--control", "unix:/var/run/control.unit.sock"] diff --git a/pkg/docker/Dockerfile.python2.7 b/pkg/docker/Dockerfile.python2.7 index 61a3e655..eb599f95 100644 --- a/pkg/docker/Dockerfile.python2.7 +++ b/pkg/docker/Dockerfile.python2.7 @@ -2,7 +2,7 @@ FROM debian:stretch-slim LABEL maintainer="NGINX Docker Maintainers <docker-maint@nginx.com>" -ENV UNIT_VERSION 1.11.0-2~stretch +ENV UNIT_VERSION 1.12.0-1~stretch RUN set -x \ && apt-get update \ @@ -86,4 +86,8 @@ RUN ln -sf /dev/stdout /var/log/unit.log STOPSIGNAL SIGTERM +COPY docker-entrypoint.sh /usr/local/bin/ +RUN mkdir /docker-entrypoint.d/ +ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] + CMD ["unitd", "--no-daemon", "--control", "unix:/var/run/control.unit.sock"] diff --git a/pkg/docker/Dockerfile.python3.5 b/pkg/docker/Dockerfile.python3.5 index 85c0ccb9..362fb3ed 100644 --- a/pkg/docker/Dockerfile.python3.5 +++ b/pkg/docker/Dockerfile.python3.5 @@ -2,7 +2,7 @@ FROM debian:stretch-slim LABEL maintainer="NGINX Docker Maintainers <docker-maint@nginx.com>" -ENV UNIT_VERSION 1.11.0-2~stretch +ENV UNIT_VERSION 1.12.0-1~stretch RUN set -x \ && apt-get update \ @@ -86,4 +86,8 @@ RUN ln -sf /dev/stdout /var/log/unit.log STOPSIGNAL SIGTERM +COPY docker-entrypoint.sh /usr/local/bin/ +RUN mkdir /docker-entrypoint.d/ +ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] + CMD ["unitd", "--no-daemon", "--control", "unix:/var/run/control.unit.sock"] diff --git a/pkg/docker/Dockerfile.ruby2.3 b/pkg/docker/Dockerfile.ruby2.3 index 253e9ed0..cc2e8637 100644 --- a/pkg/docker/Dockerfile.ruby2.3 +++ b/pkg/docker/Dockerfile.ruby2.3 @@ -2,7 +2,7 @@ FROM debian:stretch-slim LABEL maintainer="NGINX Docker Maintainers <docker-maint@nginx.com>" -ENV UNIT_VERSION 1.11.0-2~stretch +ENV UNIT_VERSION 1.12.0-1~stretch RUN set -x \ && apt-get update \ @@ -86,4 +86,8 @@ RUN ln -sf /dev/stdout /var/log/unit.log STOPSIGNAL SIGTERM +COPY docker-entrypoint.sh /usr/local/bin/ +RUN mkdir /docker-entrypoint.d/ +ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] + CMD ["unitd", "--no-daemon", "--control", "unix:/var/run/control.unit.sock"] diff --git a/pkg/docker/Dockerfile.tmpl b/pkg/docker/Dockerfile.tmpl index 18d6d34e..c721931b 100644 --- a/pkg/docker/Dockerfile.tmpl +++ b/pkg/docker/Dockerfile.tmpl @@ -86,4 +86,8 @@ RUN ln -sf /dev/stdout /var/log/unit.log STOPSIGNAL SIGTERM +COPY docker-entrypoint.sh /usr/local/bin/ +RUN mkdir /docker-entrypoint.d/ +ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] + CMD ["unitd", "--no-daemon", "--control", "unix:/var/run/control.unit.sock"] diff --git a/pkg/docker/Makefile b/pkg/docker/Makefile index b4ed95f4..e826cb95 100644 --- a/pkg/docker/Makefile +++ b/pkg/docker/Makefile @@ -2,7 +2,7 @@ include ../../version -DEFAULT_RELEASE := 2 +DEFAULT_RELEASE := 1 VERSION ?= $(NXT_VERSION) RELEASE ?= $(DEFAULT_RELEASE) diff --git a/pkg/docker/docker-entrypoint.sh b/pkg/docker/docker-entrypoint.sh new file mode 100755 index 00000000..4ad7cb9a --- /dev/null +++ b/pkg/docker/docker-entrypoint.sh @@ -0,0 +1,71 @@ +#!/usr/bin/env bash + +set -e + +curl_put() +{ + RET=`/usr/bin/curl -s -w '%{http_code}' -X PUT --data-binary @$1 --unix-socket /var/run/control.unit.sock http://localhost/$2` + RET_BODY=${RET::-3} + RET_STATUS=$(echo $RET | /usr/bin/tail -c 4) + if [ "$RET_STATUS" -ne "200" ]; then + echo "$0: Error: HTTP response status code is '$RET_STATUS'" + echo "$RET_BODY" + return 1 + else + echo "$0: OK: HTTP response status code is '$RET_STATUS'" + echo "$RET_BODY" + fi + return 0 +} + +if [ "$1" = "unitd" ]; then + if /usr/bin/find "/var/lib/unit/" -mindepth 1 -print -quit 2>/dev/null | /bin/grep -q .; then + echo "$0: /var/lib/unit/ is not empty, skipping initial configuration..." + else + if /usr/bin/find "/docker-entrypoint.d/" -mindepth 1 -print -quit 2>/dev/null | /bin/grep -q .; then + echo "$0: /docker-entrypoint.d/ is not empty, launching Unit daemon to perform initial configuration..." + /usr/sbin/unitd --control unix:/var/run/control.unit.sock + + while [ ! -S /var/run/control.unit.sock ]; do echo "$0: Waiting for control socket to be created..."; /bin/sleep 0.1; done + # even when the control socket exists, it does not mean unit has finished initialisation + # this curl call will get a reply once unit is fully launched + /usr/bin/curl -s -X GET --unix-socket /var/run/control.unit.sock http://localhost/ + + echo "$0: Looking for certificate bundles in /docker-entrypoint.d/..." + for f in $(/usr/bin/find /docker-entrypoint.d/ -type f -name "*.pem"); do + echo "$0: Uploading certificates bundle: $f" + curl_put $f "certificates/$(basename $f .pem)" + done + + echo "$0: Looking for configuration snippets in /docker-entrypoint.d/..." + for f in $(/usr/bin/find /docker-entrypoint.d/ -type f -name "*.json"); do + echo "$0: Applying configuration $f"; + curl_put $f "config" + done + + echo "$0: Looking for shell scripts in /docker-entrypoint.d/..." + for f in $(/usr/bin/find /docker-entrypoint.d/ -type f -name "*.sh"); do + echo "$0: Launching $f"; + "$f" + done + + # warn on filetypes we don't know what to do with + for f in $(/usr/bin/find /docker-entrypoint.d/ -type f -not -name "*.sh" -not -name "*.json" -not -name "*.pem"); do + echo "$0: Ignoring $f"; + done + + echo "$0: Stopping Unit daemon after initial configuration..." + kill -TERM `/bin/cat /var/run/unit.pid` + + while [ -S /var/run/control.unit.sock ]; do echo "$0: Waiting for control socket to be removed..."; /bin/sleep 0.1; done + + echo + echo "$0: Unit initial configuration complete; ready for start up..." + echo + else + echo "$0: /docker-entrypoint.d/ is empty, skipping initial configuration..." + fi + fi +fi + +exec "$@" diff --git a/pkg/rpm/Makefile b/pkg/rpm/Makefile index af6c61b1..4e970e45 100644 --- a/pkg/rpm/Makefile +++ b/pkg/rpm/Makefile @@ -2,7 +2,7 @@ include ../../version -DEFAULT_RELEASE := 2 +DEFAULT_RELEASE := 1 VERSION ?= $(NXT_VERSION) RELEASE ?= $(DEFAULT_RELEASE) diff --git a/pkg/rpm/Makefile.go b/pkg/rpm/Makefile.go index bdfb20ce..09dffd21 100644 --- a/pkg/rpm/Makefile.go +++ b/pkg/rpm/Makefile.go @@ -4,7 +4,7 @@ MODULE_SUFFIX_go= go MODULE_SUMMARY_go= Go module for NGINX Unit MODULE_VERSION_go= $(VERSION) -MODULE_RELEASE_go= 2 +MODULE_RELEASE_go= 1 MODULE_CONFARGS_go= go --go-path=%{gopath} MODULE_MAKEARGS_go= go diff --git a/pkg/rpm/Makefile.jsc-common b/pkg/rpm/Makefile.jsc-common index 68d7721d..d8c308de 100644 --- a/pkg/rpm/Makefile.jsc-common +++ b/pkg/rpm/Makefile.jsc-common @@ -4,7 +4,7 @@ MODULE_SUFFIX_jsc_common= jsc-common MODULE_SUMMARY_jsc_common= Java shared packages for NGINX Unit MODULE_VERSION_jsc_common= $(VERSION) -MODULE_RELEASE_jsc_common= 2 +MODULE_RELEASE_jsc_common= 1 JAVA_ARCH_jsc_common= $(shell /usr/lib/jvm/java-1.8.0/bin/java -XshowSettings 2>&1 | grep -F -e os.arch | sed -e 's/^.*= //') diff --git a/pkg/rpm/Makefile.jsc11 b/pkg/rpm/Makefile.jsc11 index 522e0bf2..38efa2a9 100644 --- a/pkg/rpm/Makefile.jsc11 +++ b/pkg/rpm/Makefile.jsc11 @@ -4,7 +4,7 @@ MODULE_SUFFIX_jsc11= jsc11 MODULE_SUMMARY_jsc11= Java 11 module for NGINX Unit MODULE_VERSION_jsc11= $(VERSION) -MODULE_RELEASE_jsc11= 2 +MODULE_RELEASE_jsc11= 1 MODULE_CONFARGS_jsc11= java --module=java11 --home=/usr/lib/jvm/java-11 --lib-path=/usr/lib/jvm/jre-11/lib/server --jars=/usr/share/unit-jsc-common/ MODULE_MAKEARGS_jsc11= java11 diff --git a/pkg/rpm/Makefile.jsc8 b/pkg/rpm/Makefile.jsc8 index 59ba9b8d..58e2368b 100644 --- a/pkg/rpm/Makefile.jsc8 +++ b/pkg/rpm/Makefile.jsc8 @@ -4,7 +4,7 @@ MODULE_SUFFIX_jsc8= jsc8 MODULE_SUMMARY_jsc8= Java 8 module for NGINX Unit MODULE_VERSION_jsc8= $(VERSION) -MODULE_RELEASE_jsc8= 2 +MODULE_RELEASE_jsc8= 1 JAVA_ARCH_jsc8= $(shell /usr/lib/jvm/java-1.8.0/bin/java -XshowSettings 2>&1 | grep -F -e os.arch | sed -e 's/^.*= //') diff --git a/pkg/rpm/Makefile.perl b/pkg/rpm/Makefile.perl index 8f408247..f59b7353 100644 --- a/pkg/rpm/Makefile.perl +++ b/pkg/rpm/Makefile.perl @@ -4,7 +4,7 @@ MODULE_SUFFIX_perl= perl MODULE_SUMMARY_perl= Perl module for NGINX Unit MODULE_VERSION_perl= $(VERSION) -MODULE_RELEASE_perl= 2 +MODULE_RELEASE_perl= 1 MODULE_CONFARGS_perl= perl MODULE_MAKEARGS_perl= perl diff --git a/pkg/rpm/Makefile.php b/pkg/rpm/Makefile.php index 9efa3ecf..8f39efc0 100644 --- a/pkg/rpm/Makefile.php +++ b/pkg/rpm/Makefile.php @@ -4,7 +4,7 @@ MODULE_SUFFIX_php= php MODULE_SUMMARY_php= PHP module for NGINX Unit MODULE_VERSION_php= $(VERSION) -MODULE_RELEASE_php= 2 +MODULE_RELEASE_php= 1 MODULE_CONFARGS_php= php MODULE_MAKEARGS_php= php diff --git a/pkg/rpm/Makefile.python b/pkg/rpm/Makefile.python index 4a1dfcad..334d62c1 100644 --- a/pkg/rpm/Makefile.python +++ b/pkg/rpm/Makefile.python @@ -4,7 +4,7 @@ MODULE_SUFFIX_python= python MODULE_SUMMARY_python= Python module for NGINX Unit MODULE_VERSION_python= $(VERSION) -MODULE_RELEASE_python= 2 +MODULE_RELEASE_python= 1 MODULE_CONFARGS_python= python MODULE_MAKEARGS_python= python diff --git a/pkg/rpm/Makefile.python27 b/pkg/rpm/Makefile.python27 index add58d7b..95b392a9 100644 --- a/pkg/rpm/Makefile.python27 +++ b/pkg/rpm/Makefile.python27 @@ -4,7 +4,7 @@ MODULE_SUFFIX_python27= python2.7 MODULE_SUMMARY_python27= Python 2.7 module for NGINX Unit MODULE_VERSION_python27= $(VERSION) -MODULE_RELEASE_python27= 2 +MODULE_RELEASE_python27= 1 MODULE_CONFARGS_python27= python --config=python2.7-config MODULE_MAKEARGS_python27= python2.7 diff --git a/pkg/rpm/Makefile.python34 b/pkg/rpm/Makefile.python34 index 75fc7085..83c0bdb6 100644 --- a/pkg/rpm/Makefile.python34 +++ b/pkg/rpm/Makefile.python34 @@ -4,7 +4,7 @@ MODULE_SUFFIX_python34= python3.4 MODULE_SUMMARY_python34= Python 3.4 module for NGINX Unit MODULE_VERSION_python34= $(VERSION) -MODULE_RELEASE_python34= 2 +MODULE_RELEASE_python34= 1 MODULE_CONFARGS_python34= python --config=python3.4-config MODULE_MAKEARGS_python34= python3.4 diff --git a/pkg/rpm/Makefile.python35 b/pkg/rpm/Makefile.python35 index fd4d0026..6f866771 100644 --- a/pkg/rpm/Makefile.python35 +++ b/pkg/rpm/Makefile.python35 @@ -4,7 +4,7 @@ MODULE_SUFFIX_python35= python3.5 MODULE_SUMMARY_python35= Python 3.5 module for NGINX Unit MODULE_VERSION_python35= $(VERSION) -MODULE_RELEASE_python35= 2 +MODULE_RELEASE_python35= 1 MODULE_CONFARGS_python35= python --config=python3.5-config MODULE_MAKEARGS_python35= python3.5 diff --git a/pkg/rpm/Makefile.python36 b/pkg/rpm/Makefile.python36 index 35df2e28..25e33968 100644 --- a/pkg/rpm/Makefile.python36 +++ b/pkg/rpm/Makefile.python36 @@ -4,7 +4,7 @@ MODULE_SUFFIX_python36= python3.6 MODULE_SUMMARY_python36= Python 3.6 module for NGINX Unit MODULE_VERSION_python36= $(VERSION) -MODULE_RELEASE_python36= 2 +MODULE_RELEASE_python36= 1 MODULE_CONFARGS_python36= python --config=python3.6-config MODULE_MAKEARGS_python36= python3.6 diff --git a/pkg/rpm/Makefile.python37 b/pkg/rpm/Makefile.python37 index 9d52628e..ed9462b8 100644 --- a/pkg/rpm/Makefile.python37 +++ b/pkg/rpm/Makefile.python37 @@ -4,7 +4,7 @@ MODULE_SUFFIX_python37= python3.7 MODULE_SUMMARY_python37= Python 3.7 module for NGINX Unit MODULE_VERSION_python37= $(VERSION) -MODULE_RELEASE_python37= 2 +MODULE_RELEASE_python37= 1 MODULE_CONFARGS_python37= python --config=python3.7-config MODULE_MAKEARGS_python37= python3.7 diff --git a/pkg/rpm/Makefile.ruby b/pkg/rpm/Makefile.ruby index c34a193e..51c2949d 100644 --- a/pkg/rpm/Makefile.ruby +++ b/pkg/rpm/Makefile.ruby @@ -4,7 +4,7 @@ MODULE_SUFFIX_ruby= ruby MODULE_SUMMARY_ruby= Ruby module for NGINX Unit MODULE_VERSION_ruby= $(VERSION) -MODULE_RELEASE_ruby= 2 +MODULE_RELEASE_ruby= 1 MODULE_CONFARGS_ruby= ruby MODULE_MAKEARGS_ruby= ruby diff --git a/pkg/rpm/rpmbuild/SOURCES/unit.logrotate b/pkg/rpm/rpmbuild/SOURCES/unit.logrotate index 8fb00199..806e4594 100644 --- a/pkg/rpm/rpmbuild/SOURCES/unit.logrotate +++ b/pkg/rpm/rpmbuild/SOURCES/unit.logrotate @@ -1,5 +1,9 @@ /var/log/unit/*.log { + daily missingok + rotate 7 + compress + delaycompress nocreate notifempty postrotate |