Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for resolv.conf detection and specification #1547

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion auto/modules
Original file line number Diff line number Diff line change
Expand Up @@ -1437,7 +1437,6 @@ have=T_NGX_MASTER_ENV . auto/have
have=T_PIPES . auto/have
have=T_NGX_INPUT_BODY_FILTER . auto/have
have=T_NGX_GZIP_CLEAR_ETAG . auto/have
have=T_NGX_RESOLVER_FILE . auto/have
have=T_DEPRECATED . auto/have
have=T_NGX_VARS . auto/have
have=T_NGX_HTTP_STUB_STATUS . auto/have
Expand Down
7 changes: 7 additions & 0 deletions auto/options
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ LUAJIT_LIB=$LUAJIT_LIB
LUA_INC=$LUA_INC
LUA_LIB=$LUA_LIB

NGX_RESOLVER_FILE=

USE_LIBXSLT=NO
USE_LIBGD=NO
USE_GEOIP=NO
Expand Down Expand Up @@ -309,6 +311,9 @@ $0: warning: the \"--with-ipv6\" option is deprecated"
--with-lua-inc=*) LUA_INC="$value" ;;
--with-lua-lib=*) LUA_LIB="$value" ;;

# RESOLV
--with-resolve-file=*) NGX_RESOLVER_FILE="$value" ;;

# STUB
--with-http_stub_status_module) HTTP_STUB_STATUS=YES ;;

Expand Down Expand Up @@ -545,6 +550,7 @@ cat << END
--with-luajit-lib=PATH set LuaJIT library path (where libluajit-5.1.{a,so} are located)
--with-lua-inc=PATH set Lua headers path (where lua.h/lauxlib.h/... are located)
--with-lua-lib=PATH set Lua library path (where liblua.{a,so} are located, only support Lua-5.1.x)
--with-resolve-file=PATH unconditionally specify complete path to resolv.conf, e.g. /etc/resolv.conf
--http-log-path=PATH set http access log pathname
--http-client-body-temp-path=PATH set path to store
http client request body temporary files
Expand Down Expand Up @@ -672,3 +678,4 @@ case ".$NGX_PERL_MODULES" in
NGX_PERL_MODULES=$NGX_PREFIX/$NGX_PERL_MODULES
;;
esac

6 changes: 6 additions & 0 deletions auto/summary
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,10 @@ if [ $HTTP_SCGI = YES ]; then
echo " nginx http scgi temporary files: \"$NGX_HTTP_SCGI_TEMP_PATH\""
fi

if test -n "$NGX_RESOLVER_FILE"; then
echo " resolv.conf file: \"$NGX_RESOLVER_FILE\""
else
echo " resolv.conf file: n/a"
fi

echo "$NGX_POST_CONF_MSG"
15 changes: 11 additions & 4 deletions auto/unix
Original file line number Diff line number Diff line change
Expand Up @@ -1082,9 +1082,16 @@ ngx_feature_test='int fd;
if (open("/proc/stat", O_RDONLY) == -1) return 1;'
. auto/feature


# Auto read nameserver from /etc/resolv.conf.
if [ -f "/etc/resolv.conf" ]; then
have=NGX_RESOLVER_FILE value="\"/etc/resolv.conf\"" . auto/define
if [ -z "$NGX_RESOLVER_FILE" ]; then
# Auto read nameserver from /etc/resolv.conf.
if [ -f "/etc/resolv.conf" ]; then
NGX_RESOLVER_FILE="/etc/resolv.conf"
fi
fi

if [ -n "$NGX_RESOLVER_FILE" ]; then
have=NGX_RESOLVER_FILE
value=\"$NGX_RESOLVER_FILE\"
. auto/define
have=T_NGX_RESOLVER_FILE . auto/have
fi