From: Michael Grinnell (grinnell@american.edu)
Date: Thu May 17 2001 - 13:46:57 CDT
Hi, I'm setting up a test netreg machine with the idea of rolling out a
full registration system by fall.
My test system:
P200 MMX
64MB RAM
1 GB HDD
OpenBSD 2.8
dhcp-3.0rc4
bind-9.1.2rc1
netreg-1.2
Apache system included with OpenBSD
One of the problems that I have run into is the awk snippets in admin.cgi
and refresh-dhcpdconf. The lines that I'm having trouble with are below.
admin.cgi:
$PID1=`ps aux|grep dhcpd|grep -v grep|awk \'\{print \$2\ " -- " \$9}\'`;
refresh-dhcpdconf:
if [ "`ps aux|grep dhcpd|grep -v grep|awk '{print $2}'`" != "`cat
/var/run/dhcpd.pid`" ]; then
These lines look at the ps output and strip pids out of it. Unfortunately
on my system they don't seem to work. They work at the command line, just
not in the scripts themselves.
For the admin.cgi script, the server manager page reports dhcpd, httpd, and
named as being down, even though they are all running. (I can't think of a
way that you could be seeing that page and Not have httpd running...)
For the refresh-dhcpdconf script, I get the following email. I have edited
the script slightly to aid in debugging.
dhcpd.conf.new is newer than dhcpd.conf...Copying dhcpd.conf to dhcpd.conf.bak
Copying dhcpd.conf.new to dhcpd.conf
Reloading the server...
/usr/sbin/dhcpdctl stop: dhcpd stopped
/usr/sbin/dhcpdctl start: dhcpd started
9313
Server start failed...copying .conf to .conf.bad
Copying dhcpd.conf.bak to dhcpd.conf
Trying to start the server...
/usr/sbin/dhcpdctl start: dhcpd (pid 9313) already running
Fatal Error: Server could not start.
The blank line is the result of
PID1=`ps aux|grep dhcpd|grep -v grep|awk '{print $2}'`
echo $PID1
which works at the command line.
bash-2.04# PID1=`ps aux|grep dhcpd|grep -v grep|awk '{print $2}'`
bash-2.04# echo $PID1
9313
bash-2.04#
The 9313 is the result of
PID2=`cat /var/run/dhcpd.pid`
echo $PID2
Obviously, the blank space and 9313 are unequal, so it thinks that the
dhcpd server didn't restart, and it tries to start it again, which doesn't
work, because it has already been started.
If anybody could point me down the right path, I would be very grateful.
Michael Grinnell
LAN Analyst
The American University
Washington, D.C.
**********************************************************************
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:35 CDT