I suggest adding: dhcpcd_eth0="-t 10" to replace: #dhcpcd_eth0="..." It would act as both a hint for how to pass DHCP arguments like the "..." did, and a comment above it could say that it limits the DHCP timeout to 10 seconds, and could explain how to change it. I think for most systems if the DHCP doesn't acquire an IP after 10 or 20 seconds, it's not going to, as something's probably unplugged or down. If someone's having a problem with the timeout, they can change it manually. I think the default should be shorter because it's what most people want, and the users who need longer should have to change it.
I forgot to mention that this is probably most useful for laptop users, and since there's no specific Gentoo for laptops distribution or anything, it is useful enough in general to be applied to the Gentoo distribution itself. Red Hat 9's init scripts only wait a few seconds, then say "Couldn't start network. Check cable?" I think this is the best way to do it.
To be honest, I don't think this is something that should be forced upon users. a default was chosen to satisfy most people, but nothing can satisfy everyone. If you want a shorter timeout, then you need to specify it manually. This is also better explained in the documentation, probably in the Gentoo Handbook, not something that needs to be added to the baselayout as a default. I'll pass this onto the docs team and let them decide if it's a worthwhile tip.
i think if we replace the '...' with '-t 10' and update the little comment it'll be fine
That sounds good, do you mean it will stay a comment though? I think it would be best if it were uncommented, and you could change the timeout value, if you wanted to. I think a better solution would be to have a dhcp_timeout_eth0 value that defaulted to 10, and was used in the net.ethX scripts. I don't think this will happen though because lots of people probably have custom net.ethX scripts by now.
*** Bug 42344 has been marked as a duplicate of this bug. ***
I agree that the default should be 10.
*** Bug 53799 has been marked as a duplicate of this bug. ***
Thanks for the suggestion guys. Depending on the dhcp server and the state of your dhcpcd cache, getting an address can take longer than 10 seconds. I'm not willing to cause failure in those cases because we set the timeout to be shorter than the default dhcpcd timeout. This is a situation where it's best to stick with the default as provided by upstream. Regarding putting #dhcpcd_eth0="-t 10" in conf.d/net, I'm not a fan of that either. Most of the time commented configurations indicate the defaults, for example see /etc/ssh/* I'd rather not put a suggestion in there that I know will break for some people. Regarding dhcp_timeout_eth0, I don't like that either. There is already a proliferation of configuration variables available in /etc/conf.d/net. I would prefer to limit the number available by making the existing variables more powerful. In the case of dhcpcd, that is already done since you are free to put "-t 10" in your own configuration. Having an extra variable for that is just unnecessary and leads to maintenance headaches in the net.eth0 script In summary, thanks for the suggestion. You are free to make this change in your own configuration, but I'm not going to change it in the baselayout distribution.
Well, I agree. However, isn't there this "backgrounding" feature Knoppix has? With it we could go on with normal booting while querying DHCP in the background, causing no delay...
Running it in the background would be good. Once, before I knew about "-t" a friend of mine said "does Linux usually take this long to start up?" I think the comment explaining how to change the timeout would be good for people like me who don't understand how DHCP works or what dhcpcd does.
i would agree with at least adding comments specific to timeouts in the /etc/conf.d/net file ... this is a *very* common 'problem' that people resolve with adding a '-t #' to their dhcp options as for backgrounding: Bug 52975
I agree, there definitly needs to be a comment for this in the default /etc/conf.d/net so that people can easily find the solution/syntax. I also noticed other uses of the net conf that have no commented usage too. Isn't there a variable for routes that is undocumented?
ok, I'll add comments
I see this bug is marked as WONTFIX ... and comments were never added to the default /etc/conf.d/net file. Shouldn't this bug be re-oppened?
re-open until comments added
comments are in latest version
Well if they are in the latest version, then the latest version was never added to portage. # /etc/conf.d/net: # $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/conf.d/net,v 1.7 2002/11/18 19:39:22 azarah Exp $