Next-in-Thread Next Message

Idea Problem and Workaround with dhcpcd 

Forum: PCMCIA Network Adapter Issues
Date: 2000, Jan 12
From: uffti

I've just upgrade to pcmcia-cs-3.1.8 in conjuction with dhcpcd-1.3.18-pl3. I've encountered two flaws :

1. dhcpcd seems to be called wrong
   in /etc/pcmcia/network dhcpcd is called with -V
   with the assumption that it's only displays the
   version information. But it print the version info
   AND makes a dhcp request (I've checked source code
   too).
2. No possibility to set hostname
   There is no way to pass thru parameters to dhcpd

I've modified /etc/pcmcia/network the way it works for me. Maybe this should be considered in future releases :

$ diff network /etc/pcmcia/ 56,73c56,74

<           if /sbin/dhcpcd -V 2>&1 | grep -q DHCP ; then
<               /sbin/dhcpcd $DEVICE >/dev/null 2>&1 || exit 1
<           else
<               # Jump through hoops for lame 0.70-era dhcpcd
<               L=/var/run/dhcp-lock-$DEVICE
<               /bin/echo "#!/bin/sh\nrm $L" > $L ; chmod +x $L
<               /sbin/dhcpcd -c $L $DEVICE >/dev/null 2>&1
<               for t in 0 1 2 3 4 5 6 7 8 9 ; do
<                   sleep 2 ; if [ ! -e $L ] ; then break ; fi
<               done
<               rm -f $L
<               if [ -e /etc/dhcpc/resolv.conf ] ; then
<                   echo "# $DEVICE begin" > $RESOLV.N
<                   cat /etc/dhcpc/resolv.conf >> $RESOLV.N
<                   echo "# $DEVICE end" >> $RESOLV.N
<                   cat $RESOLV >> $RESOLV.N ; mv $RESOLV.N $RESOLV
<               fi
<           fi
---
>           /sbin/dhcpcd $DEVICE -h "$DHCP_HOSTNAME" || exit 1
> #         if /sbin/dhcpcd -V 2>&1 | grep -q DHCP ; then
> #             /sbin/dhcpcd $DEVICE >/dev/null 2>&1 || exit 1
> #         else
> #             # Jump through hoops for lame 0.70-era dhcpcd
> #             L=/var/run/dhcp-lock-$DEVICE
> #             /bin/echo "#!/bin/sh\nrm $L" > $L ; chmod +x $L
> #             /sbin/dhcpcd -c $L $DEVICE >/dev/null 2>&1
> #             for t in 0 1 2 3 4 5 6 7 8 9 ; do
> #                 sleep 2 ; if [ ! -e $L ] ; then break ; fi
> #             done
> #             rm -f $L
> #             if [ -e /etc/dhcpc/resolv.conf ] ; then
> #                 echo "# $DEVICE begin" > $RESOLV.N
> #                 cat /etc/dhcpc/resolv.conf >> $RESOLV.N
> #                 echo "# $DEVICE end" >> $RESOLV.N
> #                 cat $RESOLV >> $RESOLV.N ; mv $RESOLV.N $RESOLV
> #             fi
> #         fi
154,155c155,156
<               /sbin/dhcpcd -V 2>&1 | grep -q DHCP || \
<                   rm -f /var/run/dhcpcd-$DEVICE.pid
---
> #             /sbin/dhcpcd -V 2>&1 | grep -q DHCP || \
> #                 rm -f /var/run/dhcpcd-$DEVICE.pid

Next-in-Thread Next Message

Messages Inline: 0 All Outline: 1 2 All

None Odd changes

Re: Idea Problem and Workaround with dhcpcd
Date: 2000, Jan 12
From: David Hinds <dhinds@pcmcia.sourceforge.org>

> 1. dhcpcd seems to be called wrong

I'll trust you, but this was not the case with dhcpcd-1.3.17.  Your
change sort-of defeats the purpose of the version check... instead I
would suggest changing "dhcpcd -V" to "dhcpcd -V bogus", which will
hopefully just print the version info and error out.  Can you check
that with dhcpcd-1.3.18?

-- Dave
1. None yes it works by uffti, 2000, Jan 13
Problem and Workaround with dhcpcd


Add Message to: "Problem and Workaround with dhcpcd"

Members Subscribe Admin Mode Show Frames Help for HyperNews at pcmcia-cs.sourceforge.net 1.10