Bug 76834 - chrooted ISC dhcpd cannot resolve DNS names or include configs
Summary: chrooted ISC dhcpd cannot resolve DNS names or include configs
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-29 22:40 UTC by Andrew Clark
Modified: 2005-03-10 13:44 UTC (History)
0 users

See Also:


Attachments
file.diff (738 bytes, patch)
2005-01-29 22:40 UTC, Andrew Clark
no flags Details | Diff
file.diff (1.19 KB, patch)
2005-01-29 22:40 UTC, Andrew Clark
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Clark 2005-01-29 22:40:16 UTC
This is really two problem reports in one, but both for chrooted behavior.
If running ISC dhcpd in a chroot, you cannot use hostnames in allocations.
ISC dhcpd running in a chroot needs access to a few files from /etc in order to
resolve host names from DNS.  Neither the port nor the rc script makes those
files available.  You also cannot use a configuration which is separated into
different files.

Fix: Copy those files from /etc to chroot /etc.
I believe the files needed are as follows:  

/etc/
	host.conf														
	hosts
	localtime
	resolv.conf

Here's two patches to the isc-dhcpd.sh rc script.  The first copies the above
files to the chroot at startup.  An rc variable could control this behavior.

The second allows definition of a directory to copy to the chroot at startup, 
generally for purposes of included configuration files.  This adds a new 
rc.conf variable, (I named it 'dhcpd_include_dir'), used like so:

dhcpd_include_dir="/usr/local/etc/dhcp/includes"  # dhcpd.conf includes
How-To-Repeat: Install port, insert configuration for a host like so:

host foo {
	hardware ethernet FIXME;
	fixed-address host.domain;
}

Insert line to include file in dhcpd.conf, attempt to run dhcpd in chroot and
note that file is not present in the chroot to be included.
Comment 1 Ceri Davies freebsd_committer freebsd_triage 2005-01-30 14:59:01 UTC
Class Changed
From-To: maintainer-update->change-request

Not a maintainer update - see ports/76835.
Comment 2 Ceri Davies freebsd_committer freebsd_triage 2005-01-30 15:00:46 UTC
Adding to audit trail, from misfiled PR ports/76835:

Date: Sat, 29 Jan 2005 14:54:14 -0800
From: Andrew Clark <andrew.clark@ucsb.edu>
Message-Id: <20050129225414.GA54953@oit.ucsb.edu>

 Class should change from maintainer-update -> change-request.  I'm not the
 maintainer of the port, nor did I mean to appear as a maintainer.  My
 apologies.
 
 -- 
 Andrew Clark
 Campus Network Programmer
 University of California, Santa Barbara
 andrew.clark@ucsb.edu (805) 893-5311
Comment 3 Sergey Matveychuk freebsd_committer freebsd_triage 2005-03-10 13:44:22 UTC
State Changed
From-To: open->closed

Included in maintainer's ports/78613, thanks!