Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[CLOSE]ifplugd doesn't up interface when it fails to do so b
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
cord
Guru
Guru


Joined: 28 Apr 2007
Posts: 344

PostPosted: Thu Oct 27, 2016 7:08 am    Post subject: [CLOSE]ifplugd doesn't up interface when it fails to do so b Reply with quote

Hello, I have laptop (we call it client) with wired connection (enp2s0) and dhcp on it (dnsmasq on the other end, we call it server). If I start client before server (with cable plugged) it tries to obtain network settings and fails, so net is down (it uses udhcpc from busybox, it ussually reports that 'fails to start' when dnsmasq is down on the server).
Code:
Oct 27 09:47:38 [ifplugd(enp2s0)] ifplugd 0.28 initializing.
Oct 27 09:47:38 [ifplugd(enp2s0)] Using interface enp2s0/6C:62:6D:30:D4:9E with driver <r8169> (version: 2.3LK-NAPI)
Oct 27 09:47:38 [ifplugd(enp2s0)] Using detection mode: SIOCETHTOOL
Oct 27 09:47:38 [ifplugd(enp2s0)] Initialization complete, link beat not detected.
Oct 27 09:47:51 [ifplugd(enp2s0)] Link beat detected.
Oct 27 09:47:52 [ifplugd(enp2s0)] Executing '/etc/ifplugd/ifplugd.action enp2s0 up'.
Oct 27 09:48:03 [ifplugd(enp2s0)] client:  *     start-stop-daemon: failed to start `/bin/busybox'
Oct 27 09:48:03 [ifplugd(enp2s0)] client:  * ERROR: net.enp2s0 failed to start
Oct 27 09:48:03 [ifplugd(enp2s0)] Program executed successfully.
Oct 27 09:48:18 [ifplugd(enp2s0)] Link beat lost.
Oct 27 09:48:21 [ifplugd(enp2s0)] Link beat detected.

But if I start server next it doesn't retrying to do so. I have to restart interface on client manually to get net up. So it 'thinks' that there's still no dhcp service on the server or it doesn't know is server up or down at all.

Is there way to make it retrying to up net over and over if the cable is plugged and the server is started after?


Last edited by cord on Sun Oct 30, 2016 2:05 pm; edited 1 time in total
Back to top
View user's profile Send private message
cord
Guru
Guru


Joined: 28 Apr 2007
Posts: 344

PostPosted: Sun Oct 30, 2016 2:04 pm    Post subject: Reply with quote

Seems that ifplugd checks cable position only, and no way to define the dhcp-service is running remotely or not.
But the NetworkManager can do this.
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Mon Oct 31, 2016 10:04 am    Post subject: Reply with quote

ifplugd (and other tools) have one chance to do something based on a cable event.
You have an error somewhere in /etc/ifplugd/ifplugd.action, or it's calling something that generated an error.
The error is likely of your own making - start-stop-daemon should not be calling busybox directly.

NetworkManager can do this because that logic is all self contained and compiled and you've likely not touched it.
dhcpcd will also work fine :)
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
cord
Guru
Guru


Joined: 28 Apr 2007
Posts: 344

PostPosted: Mon Oct 31, 2016 10:49 am    Post subject: Reply with quote

UberLord wrote:
ifplugd (and other tools) have one chance to do something based on a cable event.

Correct. It can't define is the 'dhcp-service' exists on the other end or not. While NetworkManager can.
UberLord wrote:
You have an error somewhere in /etc/ifplugd/ifplugd.action, or it's calling something that generated an error.
The error is likely of your own making - start-stop-daemon should not be calling busybox directly.

No. Error is generated by udhcpc which is part of busybox. So, when the server is down (no dnsmasq working at the other end, so there's no distribution of network settings) udhcpc doesn't obtain anything ("fail to do it's job"), and busybox returns start-stop-daemon error.
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Mon Oct 31, 2016 3:22 pm    Post subject: Reply with quote

So you need to tell udhcpc to background (-b flag) if it cannot get a lease. But you don't want to use the -n flag as that will cause it to exit still.
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
cord
Guru
Guru


Joined: 28 Apr 2007
Posts: 344

PostPosted: Mon Oct 31, 2016 5:23 pm    Post subject: Reply with quote

UberLord wrote:
So you need to tell udhcpc to background (-b flag) if it cannot get a lease. But you don't want to use the -n flag as that will cause it to exit still.

Well, maybe it will remove the error, but I doubt that this will set udhcpc to reasking lease again, later.
Back to top
View user's profile Send private message
cord
Guru
Guru


Joined: 28 Apr 2007
Posts: 344

PostPosted: Fri May 08, 2020 3:12 pm    Post subject: Reply with quote

So, the problem was at the remote side - dnsmasq didn't provide lease.
The correct config for it is:
Code:

resolv-file=/etc/resolv.conf
dhcp-host=03:5f:25:b6:54:a2,192.168.0.2,12h
dhcp-range=wired,192.168.0.2,static
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum