aboutsummaryrefslogtreecommitdiffstats
path: root/meta-webserver/recipes-httpd/nginx/files
diff options
context:
space:
mode:
Diffstat (limited to 'meta-webserver/recipes-httpd/nginx/files')
-rw-r--r--meta-webserver/recipes-httpd/nginx/files/0001-configure-libxslt-conf.patch39
-rw-r--r--meta-webserver/recipes-httpd/nginx/files/nginx-fix-pidfile.patch99
2 files changed, 138 insertions, 0 deletions
diff --git a/meta-webserver/recipes-httpd/nginx/files/0001-configure-libxslt-conf.patch b/meta-webserver/recipes-httpd/nginx/files/0001-configure-libxslt-conf.patch
new file mode 100644
index 0000000000..7ba2a1fb85
--- /dev/null
+++ b/meta-webserver/recipes-httpd/nginx/files/0001-configure-libxslt-conf.patch
@@ -0,0 +1,39 @@
+From 0c3c669464a514cf8d0cac08282ecb2b486f440f Mon Sep 17 00:00:00 2001
+From: Joe Slater <joe.slater@windriver.com>
+Date: Tue, 3 Oct 2023 19:21:17 +0000
+Subject: [PATCH] configure: libxslt conf
+
+Modify to find libxslt related include files under sysroot.
+
+Upstream-Status: Pending
+
+Signed-off-by: Joe Slater <joe.slater@windriver.com>
+---
+ auto/lib/libxslt/conf | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/auto/lib/libxslt/conf b/auto/lib/libxslt/conf
+index 3063ac7..eb77886 100644
+--- a/auto/lib/libxslt/conf
++++ b/auto/lib/libxslt/conf
+@@ -12,7 +12,7 @@
+ #include <libxslt/xsltInternals.h>
+ #include <libxslt/transform.h>
+ #include <libxslt/xsltutils.h>"
+- ngx_feature_path="/usr/include/libxml2"
++ ngx_feature_path="=/usr/include/libxml2"
+ ngx_feature_libs="-lxml2 -lxslt"
+ ngx_feature_test="xmlParserCtxtPtr ctxt = NULL;
+ xsltStylesheetPtr sheet = NULL;
+@@ -100,7 +100,7 @@ fi
+ ngx_feature_name=NGX_HAVE_EXSLT
+ ngx_feature_run=no
+ ngx_feature_incs="#include <libexslt/exslt.h>"
+- ngx_feature_path="/usr/include/libxml2"
++ ngx_feature_path="=/usr/include/libxml2"
+ ngx_feature_libs="-lexslt"
+ ngx_feature_test="exsltRegisterAll();"
+ . auto/feature
+--
+2.35.5
+
diff --git a/meta-webserver/recipes-httpd/nginx/files/nginx-fix-pidfile.patch b/meta-webserver/recipes-httpd/nginx/files/nginx-fix-pidfile.patch
new file mode 100644
index 0000000000..90159a6677
--- /dev/null
+++ b/meta-webserver/recipes-httpd/nginx/files/nginx-fix-pidfile.patch
@@ -0,0 +1,99 @@
+Description: Fix NGINX pidfile handling
+Author: Tj <ubuntu@iam.tj>
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/nginx/+bug/1581864
+Last-Update: 2019-06-04
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+
+Upstream-Status: Pending
+
+This patch is from ubuntu, https://github.com/aroth-arsoft/pkg-nginx/blob
+/master/debian/patches/nginx-fix-pidfile.patch, for fix below
+error info:
+nginx.service: failed to parse pid from file /run/nginx/nginx.pid:
+invalid argument
+
+Signed-off-by: Changqing Li <changqing.li@windriver.com>
+
+diff --git a/src/core/nginx.c b/src/core/nginx.c
+index 9fcb0eb2..083eba1d 100644
+--- a/src/core/nginx.c
++++ b/src/core/nginx.c
+@@ -338,14 +338,21 @@ main(int argc, char *const *argv)
+ ngx_process = NGX_PROCESS_MASTER;
+ }
+
++ /* tell-tale to detect if this is parent or child process */
++ ngx_int_t child_pid = NGX_BUSY;
++
+ #if !(NGX_WIN32)
+
+ if (ngx_init_signals(cycle->log) != NGX_OK) {
+ return 1;
+ }
+
++ /* tell-tale that this code has been executed */
++ child_pid--;
++
+ if (!ngx_inherited && ccf->daemon) {
+- if (ngx_daemon(cycle->log) != NGX_OK) {
++ child_pid = ngx_daemon(cycle->log);
++ if (child_pid == NGX_ERROR) {
+ return 1;
+ }
+
+@@ -358,8 +365,19 @@ main(int argc, char *const *argv)
+
+ #endif
+
+- if (ngx_create_pidfile(&ccf->pid, cycle->log) != NGX_OK) {
+- return 1;
++ /* If ngx_daemon() returned the child's PID in the parent process
++ * after the fork() set ngx_pid to the child_pid, which gets
++ * written to the PID file, then exit.
++ * For NGX_WIN32 always write the PID file
++ * For others, only write it from the parent process */
++ if (child_pid < NGX_OK || child_pid > NGX_OK) {
++ ngx_pid = child_pid > NGX_OK ? child_pid : ngx_pid;
++ if (ngx_create_pidfile(&ccf->pid, cycle->log) != NGX_OK) {
++ return 1;
++ }
++ }
++ if (child_pid > NGX_OK) {
++ exit(0);
+ }
+
+ if (ngx_log_redirect_stderr(cycle) != NGX_OK) {
+diff --git a/src/os/unix/ngx_daemon.c b/src/os/unix/ngx_daemon.c
+index 385c49b6..3719854c 100644
+--- a/src/os/unix/ngx_daemon.c
++++ b/src/os/unix/ngx_daemon.c
+@@ -7,14 +7,17 @@
+
+ #include <ngx_config.h>
+ #include <ngx_core.h>
++#include <unistd.h>
+
+
+ ngx_int_t
+ ngx_daemon(ngx_log_t *log)
+ {
+ int fd;
++ /* retain the return value for passing back to caller */
++ pid_t pid_child = fork();
+
+- switch (fork()) {
++ switch (pid_child) {
+ case -1:
+ ngx_log_error(NGX_LOG_EMERG, log, ngx_errno, "fork() failed");
+ return NGX_ERROR;
+@@ -23,7 +26,8 @@ ngx_daemon(ngx_log_t *log)
+ break;
+
+ default:
+- exit(0);
++ /* let caller do the exit() */
++ return pid_child;
+ }
+
+ ngx_parent = ngx_pid;