[SOLVED] dhclient running on disconnected Ethernet port
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have a simple server running Ubuntu Server. Usually the server connects to the network by Wifi, so there is usually no cable connected to the Ethernet port. I noticed that there is a dhclient3 running on eth0 anyway. It is causing undesirable disk activity. Obviously, it is never going to get a response as long as no cable is connected. I can kill the responsible process manually, but I wonder first what is starting the process and how I can prevent it from being started. If there is a way to get the server to boot without starting this process, I wonder whether this is the right solution. Connecting to the network by Ethernet is the failsafe when Wifi doesn't work. I guess what I would like to see would be a way for the server to detect when eth0 does not have a cable connected and not start dhclient in that case, but to activate dhclient when a cable is connected.
You might be interested in ifplugd: http://0pointer.de/lennart/projects/ifplugd/#overview
It monitors ethernet ports and automatically configs/deconfigs them when cables are connected. I have never used it, so I have no idea how (well) it works. If you try it, let us know how it goes!
2. In /etc/default/ifplugd, add the name of the interface (e.g., eth0) to the INTERFACES= line.
3. In /etc/network/interfaces, comment out the corresponding auto line (e.g., auto eth0). I did not comment out the companion iface eth0 line.
I rebooted, but there is an inetd in /etc/init.d so I probably could have done a restart or force-reload on it.
Now, there is no dhclient.eth0.leases process running until I plug in the Ethernet cable. When I plug in the cable, the network connects in a few seconds.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.