Hi,
I have a problem with udhcpc not calling my default.script when there is a DHCP
Renew.
I configured my TS-7260 board to start the udhcpc command to get an IP address
from a DHCP server.
$ /sbin/udhcpc -n -i eth0
info, udhcpc (v0.9.9-pre) started
debug, Sending discover...
debug, Sending select for 192.168.0.1...
info, Lease of 192.168.0.1 obtained, lease time 1800
adding gateway 192.168.0.150
adding dns 192.168.0.10
adding dns 192.168.0.20
My default.script has been called by udhcpc with a "bound" event, which does
the ifconfig and update the resolv.conf.
Before the expiry of the lease time, I forced a DHCP renew. I did that by
sending a SIGUSR1 to the udhcpc process (pid: 181)
$ kill -SIGUSR1 181
I observed via Wireshark that a DHCP Request and DCHP ACK has been exchanged
between the TS-7260 board and the DHCP server. However, my default.script was
not called upon by udhcpc at all. The same udhcpc process is still running.
So, is there a problem with the udhcpc I am using?
Below is my default.script for udhcpc:
------------------------------------------
#!/bin/sh
# udhcpc script edited by Tim Riker <>
[ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1
RESOLV_CONF="/etc/udhcpc/resolv.conf"
[ -n "$broadcast" ] && BROADCAST_STR="broadcast $broadcast"
[ -n "$subnet" ] && NETMASK_STR="netmask $subnet"
case "$1" in
deconfig)
/sbin/ifconfig $interface 0.0.0.0
if test -f /etc/sysconfig/ifcfg-$interface
then
. /etc/sysconfig/ifcfg-$interface
/sbin/ifconfig $interface ${IPADDR} broadcast ${BROADCAST} \
netmask ${NETMASK}
fi
;;
renew|bound)
/sbin/ifconfig $interface $ip $BROADCAST_STR $NETMASK_STR
if [ -n "$router" ] ; then
echo adding gateway $router
fi
if [ -n "$dns" ] ; then
echo -n > $RESOLV_CONF
for i in $dns ; do
echo adding dns $i
echo nameserver $i >> $RESOLV_CONF
done
fi
;;
esac
exit 0
------------------------------------------
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|