Skip to content

Commit

Permalink
Start nginx with -e stderr parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
lucacome committed Feb 1, 2022
1 parent 656e0d4 commit 8b23030
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/nginx/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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)
}
Expand Down

0 comments on commit 8b23030

Please sign in to comment.