From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96079040315631.tru64-unix-managers.marc@archive.invalid> From: "Sharma, Tushar" Date: Mon, 12 Apr 1999 22:21:02 +0000 To: tru64-unix-managers Subject: DHCP/Clock Related Question X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96079040315631 MIME-Version: 1 Content-Type: multipart/mixed; boundary="------_=_NextPart_001_01BE8532.C4453E66" This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_001_01BE8532.C4453E66 Content-Type: text/plain; charset="iso-8859-1" Hi Y'all, Hardware - DEC 2000 Model 300 aka DECpc 150 AXP - DHCP Client DU 4.0E (I still have one of these...) CISCO 776 ISDN Router - DHCP server Two questions. 1. In /sbin/init.d/inet there is a comment for a 'DYNAMIC' interface (aka DHCP Client) which reads as # TODO: add this name/address to /etc/hosts # if we have a hostname to go with it. If this is not done, CDE breaks because it needs a hostname in /etc/hosts for the current IP address of 'ln0'. Are there any plans to fix inet or is there a patch? I have the following home-grown set of commands which are crude but effective. # # The line containing the localipaddr as determined # by the previous call to dhcpparm is deleted # irrespective of ANY other user-entered information # related to this ip address, and, a new line is appended # to the end of /etc/hosts with the correct information as # returned by the various calls to dhcpparm. Also, entry(s) for # any other ip addresse(s) related to this host from previous incarnations # of DHCP calls are deleted. # current_hostname=`/sbin/hostname` current_dn=`/usr/sbin/dhcpparm -i $devval dn` cp -p /etc/hosts /etc/hosts.old # Just in case # # Remove entries with the current ip address from /etc/hosts # echo "Removing entries for ${localipaddr} from /etc/hosts..." echo "/${localipaddr}/ d" >/tmp/sed.tmp sed -f/tmp/sed.tmp /etc/hosts.tmp_1 rm /tmp/sed.tmp # # Remove entries with the current fully-qualified host name # from /etc/hosts # echo "Removing entries for ${current_hostname}.${current_dn} from /etc/hosts..." echo "/${current_hostname}.${current_dn}/ d" >/tmp/sed.tmp sed -f/tmp/sed.tmp /etc/hosts.tmp_2 echo "${localipaddr} ${current_hostname}.${current_dn} ${current_hostname} #Added by DHCP" >>/etc/hosts.tmp_2 mv /etc/hosts.tmp_2 /etc/hosts echo "Added following entry to /etc/hosts:" echo "${localipaddr} ${current_hostname}.${current_dn} ${current_hostname}" echo "" 2. Setting the clock on the DU 4.0E side really messes up the ARC Console. The date points to somewhere in 2028 and the ARC console will not let me boot NT. Any suggestions and/or advice welcome. .Tushar. ------_=_NextPart_001_01BE8532.C4453E66 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable DHCP/Clock Related Question

Hi Y'all,

Hardware - DEC 2000 Model 300 aka = DECpc 150 AXP - DHCP Client  DU 4.0E (I still have one of = these...)
         &nb= sp;       CISCO 776 ISDN Router - DHCP = server

Two questions.

1. In /sbin/init.d/inet there is a = comment for a 'DYNAMIC' interface (aka DHCP Client) which reads as =

    =             # TODO: add this name/address to = /etc/hosts
        =         # if we have a hostname to go with it.

  If this is not done, CDE = breaks because it needs a hostname in /etc/hosts
  for the current IP = address of 'ln0'.

  Are there any plans to = fix inet or is there a patch?

  I have the following = home-grown set of commands which are crude but effective.

        #
        # The line containing the localipaddr as = determined
        # by the previous call to dhcpparm is = deleted
        # irrespective of ANY other user-entered = information
        # related to this ip address, and, a new line is = appended
        # to the end of /etc/hosts with the correct = information as
        # returned by the various calls to dhcpparm. Also, = entry(s) for
        # any other ip addresse(s) related to this host = from previous incarnations
        # of DHCP calls are deleted.
        #
        current_hostname=3D`/sbin/hostname`
        current_dn=3D`/usr/sbin/dhcpparm -i $devval = dn`
        cp -p /etc/hosts /etc/hosts.old # Just in = case
        #
        # Remove entries with the current ip address from = /etc/hosts
        #
        echo "Removing entries for ${localipaddr} = from /etc/hosts..."
        echo "/${localipaddr}/ d" = >/tmp/sed.tmp
        sed -f/tmp/sed.tmp </etc/hosts = >/etc/hosts.tmp_1
        rm /tmp/sed.tmp
        #
        # Remove entries with the current fully-qualified = host name
        # from /etc/hosts
        #
        echo "Removing entries for = ${current_hostname}.${current_dn} from /etc/hosts..."
        echo "/${current_hostname}.${current_dn}/ = d" >/tmp/sed.tmp
        sed -f/tmp/sed.tmp <etc/hosts.tmp_1 = >/etc/hosts.tmp_2
        echo "${localipaddr}    = ${current_hostname}.${current_dn}       = ${current_hostname} #Added by DHCP" = >>/etc/hosts.tmp_2

        mv /etc/hosts.tmp_2 /etc/hosts
        echo "Added following entry to = /etc/hosts:"
        echo "${localipaddr} = ${current_hostname}.${current_dn} ${current_hostname}"
        echo ""


2. Setting the clock on the DU 4.0E = side really messes up the ARC Console. The date points to somewhere in = 2028 and the ARC console will not let me boot NT.

Any suggestions and/or advice = welcome.

.Tushar.

------_=_NextPart_001_01BE8532.C4453E66--