Re: NetReg: refresh-dhcpdconf script help

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

From: Jennifer Mehl (mehl@wi.mit.edu)
Date: Thu Jan 23 2003 - 17:08:29 CST


The DHCP server isn't actually failing with the new dhcpd.conf file if
I copy it manually and stop-start-- only if the script tries to copy it
and stop and restart dhcpd daemon does the problem occur.

Jennifer

On Thursday, January 23, 2003, at 05:18 PM, Dax wrote:

>
> I'd suggest running
>
> tail -f /var/log/messages
>
> And watching why exactly the server start is failing. You can
> eliminate LOTS of minor problems that way (like a small missing ";" or
> "}").
> Good luck.
>
> /Dax
>
> On Thu, 23 Jan 2003, Jennifer Mehl wrote:
>
>> Hi Everyone,
>>
>> I'm having a problem with the refresh-dhcpdconf script... after I make
>> a change to the dhcpd.conf.new file, when the script runs, it always
>> ends up thinking there is a problem with my new conf file, and then
>> makes the .bad file and reloads dhcpd with the old .conf file. Seems
>> to be a problem with the line beginning
>>
>> if [ "`ps -ef|grep dhcpd|grep -v grep|awk '{print $2}'`" != "`cat
>> /etc/dhcpd.pid`" ]
>>
>> and its results.
>>
>> I've tried using the Perl refresh-dhcpdconf script as well, with the
>> same result (it writes the .bad file every time).
>>
>> Can you all give me any suggestions for fixing this problem?
>> (Unfortunately, I'm not a UNIX wiz so this comes hard to me...)
>>
>> I'm running NetReg 1.3rc2 with dhcp 3.0rc10 on Solaris 8.
>>
>>
>> #!/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
>> "
>> 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 3
>> /usr/sbin/dhcpdctl start
>> if [ "`ps -ef|grep dhcpd|grep -v grep|awk '{print $2}'`" != "`cat
>> /etc/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 -ef|grep dhcpd|grep -v grep|awk '{print $2}'`" != "`cat
>> /etc/dhcpd.pid`"
>> ]; then
>> echo "Fatal Error: Server could not start."
>> fi
>> fi
>> fi
>>
>> thanks,
>> Jennifer
>>
>>
>> ---
>> Jennifer Mehl
>> Network Engineer, IT - Network Services
>> Whitehead Institute for Biomedical Research (MIT)
>> 5 Cambridge Center
>> Cambridge MA 02142
>>
>> 617.258.8930 voice
>> 617.258.5121 fax
>>
>> mehl@wi.mit.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
> **********************************************************************
>

---
Jennifer Mehl
Network Engineer, IT - Network Services
Whitehead Institute for Biomedical Research (MIT)
5 Cambridge Center
Cambridge MA 02142

617.258.8930 voice 617.258.5121 fax

mehl@wi.mit.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:38 CDT