From 8b230303f243c03eee13738c01f0997886515d04 Mon Sep 17 00:00:00 2001 From: Luca Comellini Date: Mon, 31 Jan 2022 19:38:32 -0800 Subject: [PATCH] Start nginx with -e stderr parameter --- internal/nginx/manager.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/nginx/manager.go b/internal/nginx/manager.go index 9ea835e60c..fc45859d2f 100644 --- a/internal/nginx/manager.go +++ b/internal/nginx/manager.go @@ -279,7 +279,7 @@ func (lm *LocalManager) Start(done chan error) { glog.V(3).Info("Starting nginx") binaryFilename := getBinaryFileName(lm.debug) - cmd := exec.Command(binaryFilename) + cmd := exec.Command(binaryFilename, "-e", "stderr") // #nosec G204 cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr if err := cmd.Start(); err != nil { @@ -306,7 +306,7 @@ func (lm *LocalManager) Reload(isEndpointsUpdate bool) error { t1 := time.Now() binaryFilename := getBinaryFileName(lm.debug) - if err := shellOut(fmt.Sprintf("%v -s %v", binaryFilename, "reload")); err != nil { + if err := shellOut(fmt.Sprintf("%v -s %v -e stderr", binaryFilename, "reload")); err != nil { lm.metricsCollector.IncNginxReloadErrors() return fmt.Errorf("nginx reload failed: %w", err) }