LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   How to shorten the timeout for an eth0 connection? (https://www.linuxquestions.org/questions/linux-networking-3/how-to-shorten-the-timeout-for-an-eth0-connection-81173/)

Mad Merlin 08-11-2003 11:37 PM

How to shorten the timeout for an eth0 connection?
 
Ok, here's the situation. I have a laptop that won't always be plugged into a network. Currently when I boot the laptop while unconnected, bootup will pause for ~60 seconds at eth0 initialization as it looks for a network connection. Once it times out, it picks an IP for itself and everything else goes normally. What I was wondering was how would I be able to shorten this timeout for the eth0 initialization on bootup to say 5 or 10 seconds.

The laptop in question is an IBM Thinkpad T40 running Mandrake 9.1.

slakmagik 08-12-2003 03:25 AM

I'm not sure how your files are setup. In /etc/rc.d/rc.inet1 is a line that runs dhcpcd:

/sbin/dhcpcd ${DHCP_HOSTNAME} -d eth0

Just insert '-t 10' or whatever after '/sbin/dhcpcd'.

I just did the reverse - taking it out - because I kept timing out. My power went out tonight and I couldn't reconnect.

Maybe that doesn't apply to your system, but it's something *like* that - the -t option should do it.

Robert0380 08-12-2003 03:41 AM

you could also choose to not activate it on boot and then run the command to activate it manually, or even have a script that runs the command wen u login.

Mad Merlin 08-12-2003 05:45 AM

Quote:

Originally posted by digiot
I'm not sure how your files are setup. In /etc/rc.d/rc.inet1 is a line that runs dhcpcd:

/sbin/dhcpcd ${DHCP_HOSTNAME} -d eth0

Just insert '-t 10' or whatever after '/sbin/dhcpcd'.

I just did the reverse - taking it out - because I kept timing out. My power went out tonight and I couldn't reconnect.

Maybe that doesn't apply to your system, but it's something *like* that - the -t option should do it.

I don't seem to have an /etc/rc.d/rc.inet1 file or an /sbin/dhcpcd file, I searched the entire hard drive for them with no results. However this does seem to be what I'd be looking for. I guess the file names/locations are different for Mandrake.

slakmagik 08-12-2003 06:17 AM

Yeah, I was afraid of that. I did install Mandrake briefly but I didn't pick up many details. That is weird, though, that there's not even a dhcpcd - I thought that was standard, though config files aren't. Well, there's got to be a script somewhere controlling an application somewhere that's going to have options to control its timeout. And the 60 seconds you describe is dhcpcd's default timeout.

Argh. I hate SysV.

In Debian, I have an /etc/rc.whoozits that has a symlink that goes to /etc/init.d that contains an 'inetd' script. It's a different system, script, and handles a different app but maybe it's the equivalent? And maybe *that's* on Mandrake? *g* I don't know, really - but maybe if you poke around in there, you'll find something that looks right and a man page to it may have the timeout option. Or, heck, maybe there's a gui tool in Mandrake where you can just set it from a box. Sorry I couldn't be more help.

-- Just had a thought. If your eth0 is up, do a 'ps -aux | grep -i eth0'. (Not all of that's necessary, but I like to make sure I don't miss anything.) That should show some process handling your eth0. So that'll tell you what man page to check for the timeout option.

Mad Merlin 08-12-2003 08:11 PM

It looks like eth0 is being handled by /sbin/zcip (while unplugged anyways). I checked the man page for zcip and it has no settings for timeout either. Strangely, zcip man pages reference dhcpcd and pump at the bottom, but neither have man pages installed. It turns out zcip is what is called after something (presumably dhclient) fails to find a dhcp server, and then zcip picks an ip for the computer.

When eth0 is plugged in, it's handled by dhclient. I found the man pages for this, and created the /etc/dhclient.conf page that it says it gets config details from, and put timeout 10; in it, but to no avail. When I run dhclient directly, it reflects the change, but no change in the bootup or when using 'network restart'. I dug around in the network-scripts folder and most of the /etc folder but still couldn't find anything relating to the timeout.

slakmagik 08-12-2003 09:59 PM

Damn. I think that was it. Odd that it didn't work. I'm out of ideas. (Which happens a lot.) Hopefully someone more knowledgeable will come along. Or, actually, you could try the other angles Roberto suggested. I figured you wanted to do it that way for a reason but his ideas should at least eliminate the delay.

Mad Merlin 08-12-2003 11:47 PM

Well I mostly wanted to just lower the timeout so that when I suspend/resume the laptop (which requires an init 4 first for the time being) I don't have to wait so long for the eth0 connection to timeout when unplugged. Strangely enough, I looked at the init settings for various init levels, and init 4 only kills the window manager, nothing to do with network, so I'm puzzled as to why it restarts the network connection also.


All times are GMT -5. The time now is 05:42 AM.