Skip to content

Commit

Permalink
Teach the resolv startup script to respect its enable flag.
Browse files Browse the repository at this point in the history
Reviewed by:	will, imp
Approved by:	imp
  • Loading branch information
brd committed Jan 18, 2018
1 parent 8fb0491 commit aabc882
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
2 changes: 2 additions & 0 deletions etc/defaults/rc.conf
Expand Up @@ -96,6 +96,7 @@ fsck_y_enable="NO" # Set to YES to do fsck -y if the initial preen fails.
fsck_y_flags="-T ffs:-R -T ufs:-R" # Additional flags for fsck -y
background_fsck="YES" # Attempt to run fsck in the background where possible.
background_fsck_delay="60" # Time to wait (seconds) before starting the fsck.
growfs_enable="NO" # Set to YES to attempt to grow the root filesystem on boot
netfs_types="nfs:NFS smbfs:SMB" # Net filesystems.
extra_netfs_types="NO" # List of network extra filesystem types for delayed
# mount at startup (or NO).
Expand Down Expand Up @@ -276,6 +277,7 @@ ctld_enable="NO" # CAM Target Layer / iSCSI target daemon.
local_unbound_enable="NO" # local caching resolver
blacklistd_enable="NO" # Run blacklistd daemon (YES/NO).
blacklistd_flags="" # Optional flags for blacklistd(8).
resolv_enable="YES" # Enable resolv / resolvconf

#
# kerberos. Do not run the admin daemons on slave servers
Expand Down
28 changes: 16 additions & 12 deletions etc/rc.d/resolv
Expand Up @@ -35,24 +35,28 @@

name="resolv"
desc="Create /etc/resolv.conf from kenv"
start_cmd="${name}_start"
stop_cmd=':'

load_rc_config $name

# if the info is available via dhcp/kenv
# build the resolv.conf
#
if [ -n "`/bin/kenv dhcp.domain-name-servers 2> /dev/null`" ]; then
interface="`/bin/kenv boot.netif.name`"
(
if [ -n "`/bin/kenv dhcp.domain-name 2> /dev/null`" ]; then
echo domain `/bin/kenv dhcp.domain-name`
resolv_start()
{
if [ -n "`/bin/kenv dhcp.domain-name-servers 2> /dev/null`" ]; then
interface="`/bin/kenv boot.netif.name`"
(
if [ -n "`/bin/kenv dhcp.domain-name 2> /dev/null`" ]; then
echo domain `/bin/kenv dhcp.domain-name`
fi

set -- `/bin/kenv dhcp.domain-name-servers`
for ns in `IFS=','; echo $*`; do
echo nameserver $ns
done
) | /sbin/resolvconf -a ${interface}:dhcp4
fi

set -- `/bin/kenv dhcp.domain-name-servers`
for ns in `IFS=','; echo $*`; do
echo nameserver $ns
done
) | /sbin/resolvconf -a ${interface}:dhcp4
fi
}

0 comments on commit aabc882

Please sign in to comment.