Hi all, I was trying to find out how to run a script when the IP got changed by DHCP (found how to do this, will probably write a wiki page on this) and, during my reasearch, a few questions unrelated to the initial problem came up:
1. dhcpcd option -t
-- Quote from "man dhcpcd" --
-t <timeout>
Specifies (in seconds ) for how long dhcpcd will try to get an IP address.
The default is 60 seconds. dhcpcd will not fork into background until it gets
a valid IP address in which case dhcpcd will return 0 to the parent process.
In a case dhcpcd times out before receiving a valid IP address from DHCP
server dhcpcd will return exit code 1 to the parent process.
-- end quote --
-- Quote from /etc/conf.d/dhcpcd --
DHCPCD_ARGS="-t 30 -h $HOSTNAME"
-- end quote --
Now, let's assume that my LAN DHCP server is down (powered down) and I start
my computer. dhcpcd will try to get the IP for 30 seconds and.. if it can't
get it... hmmm... just "die"? That's not what a normal user would want,
right? I mean, I'd like it to keep trying the IP *in background* for an
unlimited time, until I stop it.
2. While trying to find a more accurate documentation on the above switch,
I've noticed that there a new generation of dhcpcd, namely dhcpcd-3*. Arch is
still using dhcpcd-1. The "dhcpcd" package is marked out of date (I've just
noticed this, I don't know for how long).
* http://roy.marples.name/node/289
My question is: why is ArchLinux still using dhcpcd-1? I know that "if it
isn't broken, why fix it?" but...
I found that dhcpcd-3 mentions in the man page:
-- Quote --
-t timeout
Specifies (in seconds ) for how long dhcpcd will try to get an IP address. The
default is 20 seconds. dhcpcd will not fork into background until it gets a
valid IP address in which case dhcpcd will return 0 to the parent process.
In a case dhcpcd times out before receiving a valid IP address from
DHCP server dhcpcd will return exit code 1 to the parent process. Setting the
timeout to zero disables it: dhcp will keep trying forever to get a lease,
and if the lease is lost, it will try forever to get another.
-- end quote --
which definitely solves my first problem.
Also, dhcpcd-3 seems to store the info on the leases in /var by default (which
seems right), not /etc like dhcpcd-1 (I take this as a design improvement).
Thanks for your patience in reading this mail :)
Any feedback on the above 2 issues is welcomed.
Mircea
/IceRAM
--
http://mircea.bardac.net
pgpfaGp61y0dz.pgp
Description: PGP signature
_______________________________________________ arch mailing list [email protected] http://www.archlinux.org/mailman/listinfo/arch
