Skip to content

Commit

Permalink
run nginx when at least 1 server is defined (#184)
Browse files Browse the repository at this point in the history
to make TAR1090_DISABLE work together with serving prometheus on 9274
using nginx in ultrafeeder

run only 1 nginx worker, more should never be needed
  • Loading branch information
wiedehopf authored May 1, 2024
1 parent 2e06c66 commit 59be673
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion rootfs/etc/nginx.tar1090/nginx.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
user www-data;
worker_processes auto;
worker_processes 1;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
daemon off;
Expand Down
3 changes: 2 additions & 1 deletion rootfs/etc/s6-overlay/scripts/nginx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@

source /scripts/common

if chk_enabled "${TAR1090_DISABLE}"; then
if [[ "$(find /etc/nginx/sites-enabled/ -type f | wc -l)" == "0" ]]; then
exec sleep infinity
fi


mkdir -p /var/log/nginx

exec s6wrap --quiet --prepend=nginx --timestamps --args /usr/sbin/nginx
2 changes: 1 addition & 1 deletion rootfs/etc/s6-overlay/startup.d/02-tar1090-update
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

source /scripts/common

if ! chk_enabled "${UPDATE_TAR1090}"; then
if ! chk_enabled "${UPDATE_TAR1090}" || chk_enabled "${TAR1090_DISABLE}"; then
exit 0
fi

Expand Down
7 changes: 7 additions & 0 deletions rootfs/etc/s6-overlay/startup.d/04-tar1090-configure
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@

source /scripts/common


if chk_enabled "${TAR1090_DISABLE}"; then
rm -f /etc/nginx/sites-enabled/tar1090
exit 0
fi


# create symlink so /var/cache/fontconfig is in tmpfs
# as per Wiedehopf - https://discord.com/channels/734090820684349521/1102603003376177172/1203826726023729162
# shellcheck disable=SC2174
Expand Down
4 changes: 4 additions & 0 deletions rootfs/etc/s6-overlay/startup.d/06-range-outline
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@

source /scripts/common

if chk_enabled "${TAR1090_DISABLE}"; then
exit 0
fi

# https://github.com/wiedehopf/tar1090#heywhatsthatcom-range-outline

if [ -n "${HEYWHATSTHAT_PANORAMA_ID}" ]; then
Expand Down
8 changes: 0 additions & 8 deletions rootfs/etc/s6-overlay/startup.d/08-graphs1090-down

This file was deleted.

0 comments on commit 59be673

Please sign in to comment.