From 10d61eb3d8d8adcd0356fd855cbba4589027bfcb Mon Sep 17 00:00:00 2001 From: Oyvind Albrigtsen 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. - - + + @@ -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