RE: NetReg: DHCP refresh problems

New Message Reply Date view Thread view Subject view Author view Attachment view

From: Steve Hess (shess@wheatonma.edu)
Date: Wed Dec 17 2003 - 18:51:17 CST


Mike,
         We had this problem as well. The problem stems from the PID's not
updating as fast as the script needs. Below is our refresh-dhcpd-conf
script which has worked beautifully.

Calissa,
         Remember that all of the search scripts are looking at
dhcpd.conf. If, as Mike is asserting (and I'm assuming), the script is not
updating dhcpd.conf correctly then that is likely the cause of your search
problem. You can test this manually by copying the dhcpd.conf.new with
your registered client to dhcpd.conf and doing your search.

Steve

#!/bin/bash

# refresh-dhcpdconf for Netreg
# Belongs at /usr/local/bin/refresh-dhcpdconf

if [ /etc/dhcpd/dhcpd.conf.new -nt /etc/dhcpd/dhcpd.conf ]; then
   echo "dhcpd.conf.new is newer than dhcpd.conf...Copying dhcpd.conf to
dhcpd.conf.bak"

if [ /etc/dhcpd/dhcpd.conf.new -nt /etc/dhcpd/dhcpd.conf ]; then
   echo "dhcpd.conf.new is newer than dhcpd.conf...Copying dhcpd.conf to
dhcpd.conf.bak"
   cp /etc/dhcpd/dhcpd.conf /etc/dhcpd/dhcpd.conf.bak
   echo "Copying dhcpd.conf.new to dhcpd.conf"
   cp /etc/dhcpd/dhcpd.conf.new /etc/dhcpd/dhcpd.conf
   echo "Reloading the server..."
   /usr/sbin/dhcpdctl stop
   sleep 2
   /usr/sbin/dhcpdctl start
   sleep 2
   if [ "`ps aux|grep dhcpd|grep -v grep|grep -v refresh-dhcpdconf|awk
'{print $2}'`" != "`cat /var/run/dhcpd.pid`" ]; then
     echo "Server start failed...copying .conf to .conf.bad"
     cp /etc/dhcpd/dhcpd.conf /etc/dhcpd/dhcpd.conf.bad
     echo "Copying dhcpd.conf.bak to dhcpd.conf"
     cp /etc/dhcpd/dhcpd.conf.bak /etc/dhcpd/dhcpd.conf
     echo "Trying to start the server..."
     /usr/sbin/dhcpdctl start
     if [ "`ps aux|grep dhcpd|grep -v grep|grep -v refresh-dhcpdconf|awk
'{print $2}'`" != "`cat /var/run/dhcpd.pid`" ]; then
       echo "Fatal Error: Server could not start."
     fi
   fi
fi
~

At 07:15 PM 12/17/2003 -0500, you wrote:
>Hello!
>
>I seem to be having this same issue. I tried the change below but there
>seemed to be no effect. I've been able to determine that the clients are
>registering OK - the refresh script swaps in the dhcp.conf.new to dhcp.conf
>- then restarts the server just fine. Then I assume I am seeing the problem
>below as the script then copies dhcpd.conf to dhcpd.conf.bad and the
>dhcpd.conf.bak file into dhcp.conf and tries to start the server without
>stopping it first. (If I run the script by hand I can see this happening).
>Then it even complains that it has a fatal error and can't start anything
>even though DHCP is up and working fine.
>
>I made the changes below but that didn't seem to help. I am running Netreg
>on Redhat 9.
>
>Any ideas?
>
>Thanks in advance!
>-Mike
>
>****************************
>Michael Stella
>Network Services Administrator
>michael.stella@regiscollege.edu
>Voice: 781-768-7176
>Fax: 781-768-7344
>
>-----Original Message-----
>From: owner-netreg@southwestern.edu [mailto:owner-netreg@southwestern.edu]
>On Behalf Of Brad Pinkston
>Sent: Thursday, December 04, 2003 11:42 AM
>To: netreg@southwestern.edu
>Subject: NetReg: DHCP refresh problems
>
>It seems as though people are having trouble using the refresh-dhcpdconf
>script with other packages. There are a couple of tweaks to the script
>that may help solve these problems.
>
>Edit the file and change your paths to all dhcpd.conf files. Then change
>the line:
>
>if [ "`ps aux|grep dhcpd|grep -v grep|awk '{print $2}'`" != "`cat
>/var/run/dhcpd.pid`" ]; then
>
>to
>
>if [ "`ps axc|grep dhcpd|grep -v grep|awk '{print $1}'`" != "`cat
>/var/run/dhcpd.pid`" ]; then
>
>It seems this pid file and current running pid aren't matching up
>correctly. I experienced this with Redhat Enterprise v3.
>
>This has not been tested on any other platforms and should not be
>considered failsafe until you test all possible scenarios yourself.
>
>Hope it helps.
>
>Brad Pinkston
>Firewall/Network Administrator
>Checkpoint CCSA
>Centenary College of LA
>(318) 869-5721
>bpinksto@centenary.edu
>
>
>
>--------------------------------------------------------------------
>This email has been scanned for viruses by Centenary College of LA
>
>**********************************************************************
>To unsubscribe from this list, send an e-mail message to
>majordomo@southwestern.edu containing a single line with the words:
>unsubscribe netreg
>Send requests for assistance to: owner-netreg@southwestern.edu
>**********************************************************************
>
>**********************************************************************
>To unsubscribe from this list, send an e-mail message to
>majordomo@southwestern.edu containing a single line with the words:
>unsubscribe netreg
>Send requests for assistance to: owner-netreg@southwestern.edu
>**********************************************************************

**********************************************************************
To unsubscribe from this list, send an e-mail message to
majordomo@southwestern.edu containing a single line with the words:
unsubscribe netreg
Send requests for assistance to: owner-netreg@southwestern.edu
**********************************************************************


New Message Reply Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.4 : Thu Aug 12 2004 - 12:01:42 CDT