]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Make it a warning rather than an error if resolv.conf is missing.
authorTed Lemon <source@isc.org>
Sun, 8 Jun 1997 04:05:21 +0000 (04:05 +0000)
committerTed Lemon <source@isc.org>
Sun, 8 Jun 1997 04:05:21 +0000 (04:05 +0000)
CHANGES
common/dns.c
common/resolv.c
server/dhcpd.cat8

diff --git a/CHANGES b/CHANGES
index 6973d7c79369eb7996288d8f0a17ec2371a0eeff..f99203dba20a8241d99db9c8d3f687302905791b 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -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.
index 06442d7f34fd2650b53b7dfe6cef4fb27601dd8c..a56679bc411320ce3ef550545946c6ed8e5116cb 100644 (file)
@@ -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);
index c0a0147fae04fd5b82939d4c0c83f98f5bbff88d..7aa99d1dd14818701afb6aeba38f1ebe6316dfc6 100644 (file)
@@ -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;
index f6adf2aef019bf13decb24ece636771247958a91..735b4d15f4400bbb5b79a3b606a09de81d635dcd 100644 (file)
@@ -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.
+
 C\bCO\bOM\bMM\bMA\bAN\bND\bD L\bLI\bIN\bNE\bE
        The  names of the network interfaces on which dhcpd should
        listen for broadcasts may  be  specified  on  the  command
@@ -114,16 +124,6 @@ C\bCO\bOM\bMM\bMA\bAN\bND\bD L\bLI\bIN\bNE\bE
        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 -\b-f\bf 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  -\b-d\bd  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 @@ C\bCO\bOM\bMM\bMA\bAN\bND\bD L\bLI\bIN\bNE\bE
 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 -\b-f\bf 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  -\b-d\bd  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 @@ S\bSu\bub\bbn\bne\bet\bts\bs
        left out entirely, but the subnet statement must appear.
 
 
-L\bLe\bea\bas\bse\be L\bLe\ben\bng\bgt\bth\bhs\bs
-       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 @@ L\bLe\bea\bas\bse\be L\bLe\ben\bng\bgt\bth\bhs\bs
 dhcpd(8)                                                 dhcpd(8)
 
 
+L\bLe\bea\bas\bse\be L\bLe\ben\bng\bgt\bth\bhs\bs
+       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 @@ B\bBO\bOO\bOT\bTP\bP S\bSu\bup\bpp\bpo\bor\brt\bt
               filename "/tftpboot/haagen.boot";
             }
 
-O\bOp\bpt\bti\bio\bon\bns\bs
-       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 @@ O\bOp\bpt\bti\bio\bon\bns\bs
 dhcpd(8)                                                 dhcpd(8)
 
 
+O\bOp\bpt\bti\bio\bon\bns\bs
+       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 @@ A\bAU\bUT\bTH\bHO\bOR\bR
 
 
 
-
-
-
-
-
-
-
-
-
-
-
-
                                                                 5