[nginx] Configure: fixed nobody/nogroup detection stderr redirec...

Maxim Dounin mdounin at mdounin.ru
Wed Jun 4 23:45:29 UTC 2025


details:   http://freenginx.org/hg/nginx/rev/808c90eb3a8d
branches:  
changeset: 9368:808c90eb3a8d
user:      Maxim Dounin <mdounin at mdounin.ru>
date:      Thu Jun 05 02:37:20 2025 +0300
description:
Configure: fixed nobody/nogroup detection stderr redirection.

Previously, "grep: /etc/group: No such file or directory" errors were
printed on systems without the /etc/group file along with the configure
output.  Fix is to use correct stderr redirection.

diffstat:

 auto/unix |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (19 lines):

diff --git a/auto/unix b/auto/unix
--- a/auto/unix
+++ b/auto/unix
@@ -7,13 +7,13 @@ NGX_USER=${NGX_USER:-nobody}
 
 if [ -z "$NGX_GROUP" ]; then
     if [ $NGX_USER = nobody ]; then
-        if grep nobody /etc/group 2>&1 >/dev/null; then
+        if grep nobody /etc/group >/dev/null 2>&1; then
             echo "checking for nobody group ... found"
             NGX_GROUP=nobody
         else
             echo "checking for nobody group ... not found"
 
-            if grep nogroup /etc/group 2>&1 >/dev/null; then
+            if grep nogroup /etc/group >/dev/null 2>&1; then
                 echo "checking for nogroup group ... found"
                 NGX_GROUP=nogroup
             else


More information about the nginx-devel mailing list