<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  </head>
  <body text="#000000" bgcolor="#ffffff">
    Hi All,<br>
    <br>
        One of our requirement is not to change IPs of a machines once
    assigned. (first time assigning IPs will be dynamic). <br>
    <br>
        In order to reserver same IP for ever we decided to add the host
    entry using dhcpctl functions after dhcp assign IP for first time.
    So at the 'on commit' we decided to use 'execute' to run a script
    which will make an host entry by passing required parameters. But
    DHCP got hung when it was executing the script, the same script
    works properly when I execute from shell prompt.<br>
    <br>
    on commit {<br>
        log(debug, "On commit method");<br>
        set ClientIP = binary-to-ascii(10, 8, ".", leased-address);<br>
        set ClientMac =  binary-to-ascii (16, 8, ":",
    substring(hardware, 1, 6)); <br>
    <strong><br>
    </strong>    set ClientHostname = concat ("node-",<br>
                        suffix (concat ("0", binary-to-ascii (16, 8,
    "",substring(hardware, 4, 1))),2),"-",<br>
                        suffix (concat ("0", binary-to-ascii (16, 8,
    "",substring(hardware, 5, 1))),2),"-",<br>
                        suffix (concat ("0", binary-to-ascii (16, 8,
    "",substring(hardware, 6, 1))),2));<br>
    <br>
        log(debug, concat("Add Static entry HOSTNAME: ", ClientHostname,
    " IP: ", ClientIP, " Mac: ", ClientMac));<br>
    <br>
       
    execute("/etc/dhcpd/add_static_ip_entry","-h",ClientHostname,"-m",ClientMac,"-i",ClientIP);
    <br>
        unset ClientIP;<br>
        unset ClientMac;<br>
        unset ClientHostName;<br>
    }<br>
    <br>
    From the log I came to know that it got struck at dhcpctl_connect
    call<br>
    ...<br>
    status = dhcpctl_connect (&connection, "127.0.0.1", 9991, 0); 
    --> here call not returning dhcp hungs. <br>
    ......<br>
    Why the server is not able to connect when the same script used at
    execute method ?<br>
    <br>
    [root@LdapVM dhcpd]# netstat -anp | grep 9991<br>
    tcp        0      0 0.0.0.0:9991               
    0.0.0.0:*                   LISTEN      15923/dhcpd         <br>
    tcp        8      0 127.0.0.1:9991             
    127.0.0.1:37752             ESTABLISHED -                   <br>
    tcp        0      0 127.0.0.1:37752            
    127.0.0.1:9991              ESTABLISHED 15935/add_static_ip<br>
    <br>
    <br>
    Any other way to reserve an IP to a Machine ( static IP
    configuration at DHCP server side) <b>not at the machine.</b><br>
    <br>
    Any help would be grateful.<br>
    <br>
    Thanks,<br>
    Johnson<br>
    <br>
  <P><strong><span style='font-size:10.0pt;font-family:
"Palatino Linotype","serif";color:green'> Please do not print this email unless it is absolutely necessary. </span></strong><span style='font-family:"Arial","sans-serif"'><o:p></o:p></span></p>


<p> The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. </p>

<p>WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. </p>
<p>
www.wipro.com
</p>
</body>
</html>