From da4e4bf8daf569d972d8467737c00f115b549ad9 Mon Sep 17 00:00:00 2001 From: Yuansheng Date: Tue, 11 Sep 2018 15:47:43 +0800 Subject: [PATCH] bugfix: destroy `pool` before the daemon process exits. --- patches/nginx-1.13.6-daemon-destroy-pool.patch | 12 ++++++++++++ util/mirror-tarballs | 5 +++++ 2 files changed, 17 insertions(+) create mode 100644 patches/nginx-1.13.6-daemon-destroy-pool.patch diff --git a/patches/nginx-1.13.6-daemon-destroy-pool.patch b/patches/nginx-1.13.6-daemon-destroy-pool.patch new file mode 100644 index 0000000..8179304 --- /dev/null +++ b/patches/nginx-1.13.6-daemon-destroy-pool.patch @@ -0,0 +1,12 @@ +diff --git a/src/os/unix/ngx_daemon.c b/src/os/unix/ngx_daemon.c +index ab672110..4bf09e77 100644 +--- a/src/os/unix/ngx_daemon.c ++++ b/src/os/unix/ngx_daemon.c +@@ -23,6 +23,7 @@ ngx_daemon(ngx_log_t *log) + break; + + default: ++ ngx_destroy_pool(ngx_cycle->pool); + exit(0); + } + diff --git a/util/mirror-tarballs b/util/mirror-tarballs index ce36b85..d84f82e 100755 --- a/util/mirror-tarballs +++ b/util/mirror-tarballs @@ -65,6 +65,11 @@ if [ "$answer" = "Y" ]; then echo "$info_txt applying the resolver_conf_parsing patch for nginx" patch -p1 < $root/patches/nginx-$main_ver-resolver_conf_parsing.patch || exit 1 echo + + echo "$info_txt applying the daemon-destroy-pool patch for nginx" + patch -p1 < $root/patches/nginx-$main_ver-daemon-destroy-pool.patch || exit 1 + echo + fi answer=`$root/util/ver-ge "$main_ver" 1.5.12`