resource-agents/RHEL-112443-1-nginx-fix-validate-warnings.patch
Oyvind Albrigtsen 220cf2c062 - nginx: fix validate warnings, and restore SELinux context for
pid-file during validate-all action

  Resolves: RHEL-112443
2025-11-18 15:31:11 +01:00

67 lines
2.1 KiB
Diff

From 10d61eb3d8d8adcd0356fd855cbba4589027bfcb Mon Sep 17 00:00:00 2001
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
Date: Tue, 4 Nov 2025 12:58:18 +0100
Subject: [PATCH] nginx: fix ls-redirection, mute non-errors in validate-all,
and set unique intervals for monitor actions
---
heartbeat/nginx | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/heartbeat/nginx b/heartbeat/nginx
index cb1c6ec27a..0f856175de 100755
--- a/heartbeat/nginx
+++ b/heartbeat/nginx
@@ -251,7 +251,7 @@ nginxcat() {
close(cmd);
}
function listfiles(pattern, cmd,f) {
- cmd="ls "pattern" 2>/dev/null";
+ cmd="ls "pattern;
while( ( cmd | getline f ) > 0 ) {
printfile(f);
}
@@ -271,7 +271,7 @@ nginxcat() {
return !system("test -d \""s"\"");
}
{ procline(); }
- ' $1 |
+ ' $1 2> /dev/null |
sed 's/#.*//;s/[[:blank:]]*$//;s/^[[:blank:]]*//' |
grep -v '^$'
}
@@ -800,8 +800,8 @@ Extra options to apply when starting nginx.
<action name="status" timeout="30s" />
<action name="monitor" timeout="30s" depth="0" interval="10s" />
<action name="monitor" timeout="30s" depth="10" interval="30s" />
-<action name="monitor" timeout="45s" depth="20" />
-<action name="monitor" timeout="60s" depth="30" />
+<action name="monitor" timeout="45s" depth="20" interval="60s" />
+<action name="monitor" timeout="60s" depth="30" interval="61s" />
<action name="meta-data" timeout="5s" />
<action name="validate-all" timeout="5s" />
</actions>
@@ -847,11 +847,11 @@ validate_all_nginx() {
exit $OCF_ERR_CONFIGURED
fi
if
- ocf_run $NGINXD $OPTIONS -t -c $CONFIGFILE
+ ocf_run $NGINXD $OPTIONS -q -t -c $CONFIGFILE
then
: Cool $NGINXD likes $CONFIGFILE
else
- ocf_exit_reason "$NGINXD $OPTIONS -t -c $CONFIGFILE reported a configuration error."
+ ocf_exit_reason "$NGINXD $OPTIONS -q -t -c $CONFIGFILE reported a configuration error."
return $OCF_ERR_CONFIGURED
fi
return $OCF_SUCCESS
@@ -908,7 +908,7 @@ then
if
[ ! -z "$OCF_RESKEY_httpd" ]
then
- ocf_log info "Using $NGINXD as nginx"
+ ocf_log debug "Using $NGINXD as nginx"
fi
fi