nginx: use UCI configuration provided by nginx-util

* update to version 1.19.6

* remove default configuration files and documentation as
  they are in the package `nginx-util`.

* do not install a `/etc/nginx/nginx.conf` file.

* use the dynamic `/etc/nginx/uci.conf` if the symlink (to
  `/var/lib/nginx/uci.conf`) is not dead after calling
  `nginx-util init_lan` (else try `/etc/nginx/nginx.conf`)

* replace nginx package by a dummy depending on `nginx-ssl`;
  the dummies will be removed after a transition period.

Signed-off-by: Peter Stadler <peter.stadler@student.uibk.ac.at>
This commit is contained in:
Peter Stadler
2020-07-23 15:30:45 +02:00
parent bd49d48123
commit 5cffe853e6
6 changed files with 34 additions and 378 deletions

View File

@@ -20,9 +20,13 @@ nginx_init() {
[ -d /var/log/nginx ] || mkdir -p /var/log/nginx
[ -d /var/lib/nginx ] || mkdir -p /var/lib/nginx
rm -f "$(readlink "${UCI_CONF}")"
${NGINX_UTIL} init_lan
CONF="${NGINX_CONF}"
if [ -e "${UCI_CONF}" ]
then CONF="${UCI_CONF}"
else CONF="${NGINX_CONF}"
fi
local message
message="$(/usr/sbin/nginx -t -c "${CONF}" -g "${G_OPTS}" 2>&1)" ||
@@ -51,16 +55,14 @@ start_service() {
}
service_triggers() {
procd_add_reload_interface_trigger loopback
procd_add_reload_interface_trigger lan
}
reload_service() {
nginx_init
procd_send_signal nginx
if [ "$(cat "/proc/$(cat "/var/run/nginx.pid")/cmdline")" = \
"nginx: master process /usr/sbin/nginx -c ${CONF} -g ${G_OPTS}" ]
then procd_send_signal nginx
else restart
fi
}