FS#216 - RC.SHUTDOWN: ifdown() dhcp fix
Attached to Project:
Arch Linux
Opened by Chris Rainey (marin_linuxer) - Wednesday, 22 October 2003, 18:38 GMT
Last edited by Judd Vinet (judd) - Tuesday, 30 December 2003, 22:18 GMT
Opened by Chris Rainey (marin_linuxer) - Wednesday, 22 October 2003, 18:38 GMT
Last edited by Judd Vinet (judd) - Tuesday, 30 December 2003, 22:18 GMT
|
Details
Hi Judd,
This has been a pickle for me for some time(see http://bbs.archlinux.org/viewtopic.php?t=1579). I'm assuming that I'm not alone in the use of a consumer-grade Wi-Fi router, here, at home. These devices seem to be preset(and some are not adjustable) to long/infinite dhcp lease-times. Apparently the 'dhcpcd' kills itself if a long/infinite lease is acquired. So, as a result, a very repremanding message is produced during ifdown() in rc.d/network when a .pid is not found. I am submitting this request as a 'cosmetic' fix, but for which I believe adds additional 'polish/professionalism' to Arch and especially to nOOb's who might be confounded by it(or worst-case ... made to feel apprehensive about the stability of other inner-workings). You'll have to evaluate my 'fix' as my 'best-guess'. It would seem to suffice, since, the '*.pid' would automatically be removed upon next boot by the ifup() earlier in the script. Please let me know if I am blundering into territory I know nothing about ... :) (Please also consider adjsting 'dhcpcd -t 10' to 'dhcpcd -t 20'(as shown, below) for those of us using pcmcia Wi-Fi cards which need a few extra seconds to initialize during the boot sequence before being ready to acquire dhcp signal) FIX: ifup() { varname="\$${1}" eval new_ifline=$varname if [ "$new_ifline" = "dhcp" ]; then # remove the .pid file if it exists rm -f /etc/dhcpc/dhcpcd-${1}.{pid,cache} >/dev/null 2>&1 /usr/sbin/dhcpcd -t 20 -h $HOSTNAME $1 else /sbin/ifconfig $new_ifline fi return $? } ifdown() { varname="\$${1}" eval new_ifline=$varname if [ "$new_ifline" = "dhcp" ]; then return $? else /sbin/ifconfig $new_ifline down fi return $? } Thanx, Chris. |
This task depends upon
Closed by Anonymous Submitter
Tuesday, 30 December 2003, 22:18 GMT
Reason for closing: Fixed
Tuesday, 30 December 2003, 22:18 GMT
Reason for closing: Fixed
It seems, that, the pcmcia interface/module needs the extra time to initialize the wi-fi card. I'm wondering if there is some sort of 'delay' or 'pause' that can be worked into the network ifup() in order to allow pcmcia cards additional time to initialize and therefore be ready to accept instructions for dhcp, etc.?
#/etc/rc.d/pcmcia
[snip]
start)
[snip]
else
if [ -r $RUN/stab ] ; then
cat $RUN/stab | cleanup
fi
/sbin/cardmgr $CARDMGR_OPTS
fi
sleep 10
stat_done
;;