From: Robert Lowe (robert.h.lowe@lawrence.edu)
Date: Thu Jan 23 2003 - 16:34:53 CST
Jennifer Mehl wrote:
Jennifer,
It's a good idea to make changes to a copy of the file, then check
it with dhcpd itself, i.e. dhcpd -t -cf dhcpd.conf.whatever. You
can also check your logfiles to see what error messages are recorded
when dhcpd starts again. Remember that dhcpd.conf.new is somewhat
under the control of NetReg, so the best approach is to move the pieces
you might edit into a separate file, and use:
include "/path/file";
...in your dhcpd.conf[.new] file. That way you can make edits to it
without worrying about registrations happening underneath you.
-Robert
> 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
**********************************************************************
This archive was generated by hypermail 2.1.4 : Thu Aug 12 2004 - 12:01:38 CDT