Commit 732a90b2 authored by Ted Lemon's avatar Ted Lemon
Browse files

Make it a warning rather than an error if resolv.conf is missing.

parent 98685343
......@@ -16,6 +16,8 @@
address and the lease corresponding to that address is available to
that client.
- Make it a warning rather than an error if resolv.conf is missing.
970605
- Add client-hostname token to lexer so that the parser can use it.
......
......@@ -48,7 +48,7 @@
#ifndef lint
static char copyright[] =
"$Id: dns.c,v 1.3 1997/05/09 08:02:33 mellon Exp $ Copyright (c) 1997 The Internet Software Consortium. All rights reserved.\n";
"$Id: dns.c,v 1.4 1997/06/08 04:05:20 mellon Exp $ Copyright (c) 1997 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
......@@ -198,6 +198,9 @@ static int nslookup (id, qname, namelen, qtype, qclass)
int i, status;
struct sockaddr_in *server = pick_name_server ();
if (!server)
return 0;
/* Construct a header... */
hdr = (HEADER *)query;
memset (hdr, 0, sizeof *hdr);
......@@ -255,6 +258,9 @@ static int zonelookup (id, qname, namelen, qclass)
int i, status, count;
struct sockaddr_in *server = pick_name_server ();
if (!server)
return 0;
/* Construct a header... */
hdr = (HEADER *)query;
memset (hdr, 0, sizeof *hdr);
......
......@@ -42,7 +42,7 @@
#ifndef lint
static char copyright[] =
"$Id: resolv.c,v 1.3 1997/06/03 00:47:40 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
"$Id: resolv.c,v 1.4 1997/06/08 04:05:20 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
......@@ -66,8 +66,11 @@ void read_resolv_conf (parse_time)
new_parse (path_resolv_conf);
eol_token = 1;
if ((cfile = fopen (path_resolv_conf, "r")) == NULL)
error ("Can't open %s: %m", path_resolv_conf);
if ((cfile = fopen (path_resolv_conf, "r")) == NULL) {
warn ("Can't open %s: %m", path_resolv_conf);
return;
}
do {
token = next_token (&val, cfile);
if (token == EOF)
......@@ -184,8 +187,10 @@ struct sockaddr_in *pick_name_server ()
/* Check /etc/resolv.conf and reload it if it's changed. */
if (cur_time > rcdate) {
if (stat (path_resolv_conf, &st) < 0)
error ("Can't stat %s", path_resolv_conf);
if (stat (path_resolv_conf, &st) < 0) {
warn ("Can't stat %s", path_resolv_conf);
return (struct sockaddr_in *)0;
}
if (st.st_mtime > rcdate) {
char rcbuf [512];
char *s, *t, *u;
......
......@@ -98,6 +98,16 @@ dhcpd(8) dhcpd(8)
database, dhcpd does not automatically restart itself when
it sees a change to the dhcpd.conf file.
Note: We get a lot of complaints about this. We realize
that it would be nice if one could send a SIGHUP to the
server and have it reload the database. This is not
technically impossible, but it would require a great deal
of work, our resources are extremely limited, and they can
be better spent elsewhere. So please don't complain
about this on the mailing list unless you're prepared to
fund a project to implement this feature, or prepared to
do it yourself.
CCOOMMMMAANNDD LLIINNEE
The names of the network interfaces on which dhcpd should
listen for broadcasts may be specified on the command
......@@ -114,16 +124,6 @@ CCOOMMMMAANNDD LLIINNEE
the udp port number on which dhcpd should listen. This is
mostly useful for debugging purposes.
To run dhcpd as a foreground process, rather than allowing
it to run as a daemon in the background, the --ff flag
should be specified. This is useful when running dhcpd
under a debugger, or when running it out of inittab on
System V systems.
To have dhcpd log to the standard error descriptor, spec-
ify the --dd flag. This can be useful for debugging, and
also at sites where a complete log of all dhcp activity
must be kept but syslogd is not reliable or otherwise
......@@ -136,8 +136,18 @@ CCOOMMMMAANNDD LLIINNEE
dhcpd(8) dhcpd(8)
cannot be used. Normally, dhcpd will log all output
using the syslog(3) function with the log facility set to
To run dhcpd as a foreground process, rather than allowing
it to run as a daemon in the background, the --ff flag
should be specified. This is useful when running dhcpd
under a debugger, or when running it out of inittab on
System V systems.
To have dhcpd log to the standard error descriptor, spec-
ify the --dd flag. This can be useful for debugging, and
also at sites where a complete log of all dhcp activity
must be kept but syslogd is not reliable or otherwise can-
not be used. Normally, dhcpd will log all output using
the syslog(3) function with the log facility set to
LOG_DAEMON.
Dhcpd can be made to use an alternate configuration file
......@@ -179,17 +189,7 @@ SSuubbnneettss
left out entirely, but the subnet statement must appear.
LLeeaassee LLeennggtthhss
DHCP leases can be assigned almost any length from zero
seconds to infinity. What lease length makes sense for
any given subnet, or for any given installation, will vary
depending on the kinds of hosts being served.
For example, in an office environment where systems are
added from time to time and removed from time to time, but
move relatively infrequently, it might make sense to allow
lease times of a month of more. In a final test environ-
ment on a manufacturing floor, it may make more sense to
......@@ -202,6 +202,17 @@ LLeeaassee LLeennggtthhss
dhcpd(8) dhcpd(8)
LLeeaassee LLeennggtthhss
DHCP leases can be assigned almost any length from zero
seconds to infinity. What lease length makes sense for
any given subnet, or for any given installation, will vary
depending on the kinds of hosts being served.
For example, in an office environment where systems are
added from time to time and removed from time to time, but
move relatively infrequently, it might make sense to allow
lease times of a month of more. In a final test environ-
ment on a manufacturing floor, it may make more sense to
assign a maximum lease length of 30 minutes - enough time
to go through a simple test procedure on a network appli-
ance before packaging it up for delivery.
......@@ -244,18 +255,7 @@ BBOOOOTTPP SSuuppppoorrtt
filename "/tftpboot/haagen.boot";
}
OOppttiioonnss
DHCP (and also BOOTP with Vendor Extensions) provide a
mechanism whereby the server can provide the client with
information about how to configure its network interface
(e.g., subnet mask), and also how the client can access
various network services (e.g., DNS, IP routers, and so
on).
These options can be specified on a per-subnet basis, and,
for BOOTP clients, also on a per-client basis. In the
event that a BOOTP client declaration specifies options
that are also specified in its subnet declaration, the
......@@ -268,6 +268,18 @@ OOppttiioonnss
dhcpd(8) dhcpd(8)
OOppttiioonnss
DHCP (and also BOOTP with Vendor Extensions) provide a
mechanism whereby the server can provide the client with
information about how to configure its network interface
(e.g., subnet mask), and also how the client can access
various network services (e.g., DNS, IP routers, and so
on).
These options can be specified on a per-subnet basis, and,
for BOOTP clients, also on a per-client basis. In the
event that a BOOTP client declaration specifies options
that are also specified in its subnet declaration, the
options specified in the client declaration take prece-
dence. An reasonably complete DHCP configuration might
look something like this:
......@@ -313,18 +325,6 @@ AAUUTTHHOORR
5
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment