dns_sortlist and dns_options now work as documented, #175367.

This commit is contained in:
Roy Marples 2007-05-03 11:21:26 +00:00
parent b4a3796b01
commit e5a82d5fe6
4 changed files with 19 additions and 9 deletions

View File

@ -1,6 +1,10 @@
# ChangeLog for Gentoo System Intialization ("rc") scripts # ChangeLog for Gentoo System Intialization ("rc") scripts
# Copyright 1999-2007 Gentoo Foundation; Distributed under the GPLv2 # Copyright 1999-2007 Gentoo Foundation; Distributed under the GPLv2
03 May 2007; Roy Marples <uberlord@gentoo.org>:
dns_sortlist and dns_options now work as documented, #175367.
02 May 2007; Roy Marples <uberlord@gentoo.org>: 02 May 2007; Roy Marples <uberlord@gentoo.org>:
SSD_NICELEVEL can now affect the nicelevel for daemons started SSD_NICELEVEL can now affect the nicelevel for daemons started

View File

@ -345,12 +345,8 @@
# For configuring system specifics such as domain, dns, ntp and nis servers # For configuring system specifics such as domain, dns, ntp and nis servers
# It's rare that you would need todo this, but you can anyway. # It's rare that you would need todo this, but you can anyway.
# This is most benefit to wireless users who don't use DHCP so they can change # This is most benefit to wireless users who don't use DHCP so they can change
# their configs based on SSID. See above for more details # their configs based on SSID.
# Setting name/domain server causes /etc/resolv.conf to be overwritten
# Note that if DHCP is used, and you want this to take precedence then
# set dhcp_SSID="nodns"
# To use dns settings such as these, dns_servers_eth0 must be set!
# If you omit the _eth0 suffix, then it applies to all interfaces unless # If you omit the _eth0 suffix, then it applies to all interfaces unless
# overridden by the interface suffix. # overridden by the interface suffix.
#dns_domain_eth0="your.domain" #dns_domain_eth0="your.domain"

View File

@ -867,7 +867,6 @@
# This is most benefit to wireless users who don't use DHCP so they can change # This is most benefit to wireless users who don't use DHCP so they can change
# their configs based on SSID. # their configs based on SSID.
# To use dns settings such as these, dns_servers_eth0 must be set!
# If you omit the _eth0 suffix, then it applies to all interfaces unless # If you omit the _eth0 suffix, then it applies to all interfaces unless
# overridden by the interface suffix. # overridden by the interface suffix.
#dns_domain_eth0="your.domain" #dns_domain_eth0="your.domain"

View File

@ -2,6 +2,7 @@
# Distributed under the terms of the GNU General Public License v2 # Distributed under the terms of the GNU General Public License v2
_config_vars="$_config_vars dns_servers dns_domain dns_search" _config_vars="$_config_vars dns_servers dns_domain dns_search"
_config_vars="$_config_vars dns_sortlist dns_options"
_config_vars="$_config_vars ntp_servers nis_servers nis_domain" _config_vars="$_config_vars ntp_servers nis_servers nis_domain"
system_depend() { system_depend() {
@ -10,7 +11,7 @@ system_depend() {
} }
_system_dns() { _system_dns() {
local servers= domain= search= x= local servers= domain= search= sortlist= options= x=
eval servers=\$dns_servers_${IFVAR} eval servers=\$dns_servers_${IFVAR}
[ -z "${servers}" ] && servers=${dns_servers} [ -z "${servers}" ] && servers=${dns_servers}
@ -20,8 +21,15 @@ _system_dns() {
eval search=\$dns_search_${IFVAR} eval search=\$dns_search_${IFVAR}
[ -z "${search}" ] && search=${dns_search} [ -z "${search}" ] && search=${dns_search}
[ -z "${servers}" -a -z "${domain}" -a -z "${search}" ] && return 0 eval sortlist=\$dns_sortlist_${IFVAR}
[ -z "${sortlist}" ] && sortlist=${dns_sortlist}
eval options=\$dns_options_${IFVAR}
[ -z "${options}" ] && options=${dns_options}
[ -z "${servers}" -a -z "${domain}" -a -z "${search}" \
-a -z "${sortlist}" -a -z "${options}" ] && return 0
local buffer="# Generated by net-scripts for interface ${IFACE}\n" local buffer="# Generated by net-scripts for interface ${IFACE}\n"
[ -n "${domain}" ] && buffer="${buffer}domain ${domain}\n" [ -n "${domain}" ] && buffer="${buffer}domain ${domain}\n"
@ -31,6 +39,9 @@ _system_dns() {
buffer="${buffer}nameserver ${x}\n" buffer="${buffer}nameserver ${x}\n"
done done
[ -n "${sortlist}" ] && buffer="${buffer}sortlist ${sortlist}\n"
[ -n "${options}" ] && buffer="${buffer}options ${options}\n"
# Support resolvconf if we have it. # Support resolvconf if we have it.
if [ -x /sbin/resolvconf ] ; then if [ -x /sbin/resolvconf ] ; then
printf "${buffer}" | resolvconf -a "${IFACE}" printf "${buffer}" | resolvconf -a "${IFACE}"