You are not logged in.

#1 2013-04-12 18:47:06

noahsark1126
Member
Registered: 2008-08-28
Posts: 117

netctl-ifplugd exits when USB NIC is unplugged

I'm trying to use netctl-ifplugd with a USB to ethernet adapter (my laptop does not have a built-in ethernet port).  I have netctl-ifplugd@eth0.service enabled.  It starts properly at boot (even if the USB NIC is unplugged), and it configures the interface correctly when plugged.

Now, if I only remove the ethernet cable but leave the NIC plugged, then the interface deconfigures and ifplugd continues running.

But if I remove the USB NIC from the computer, ifplugd stops completely.  So next time I plug it in, nothing happens.  Here are the relevant lines from the journal:

ifplugd[1044]: Link beat lost.
ifplugd[1044]: Executing '/etc/ifplugd/netctl.action eth0 down'.
ifplugd[1044]: client: Stopping network profile 'wired'...
ifplugd[1044]: client: /usr/lib/network/network: line 17: /sys/class/net/eth0/flags: No such file or directory
ifplugd[1044]: client: Stopped network profile 'wired'
ifplugd[1044]: Program executed successfully.
ifplugd[1044]: Exiting.

This used to work fine with net-auto-wired in netcfg.

Offline

#2 2013-04-12 20:05:14

neildarlow
Member
From: United Kingdom
Registered: 2007-10-23
Posts: 17

Re: netctl-ifplugd exits when USB NIC is unplugged

Isn't just removing the cable the right thing to do? By unplugging the USB-Ethernet adapter you are removing a chunk of networking hardware. The journal indicates that vital state information for eth0 has disappeared which bears this out. I wouldn't expect netctl to perform exactly as netcfg did and perhaps netcfg's previous behaviour was more due to luck than design.

Offline

#3 2013-04-12 20:29:04

noahsark1126
Member
Registered: 2008-08-28
Posts: 117

Re: netctl-ifplugd exits when USB NIC is unplugged

neildarlow wrote:

Isn't just removing the cable the right thing to do? By unplugging the USB-Ethernet adapter you are removing a chunk of networking hardware. The journal indicates that vital state information for eth0 has disappeared which bears this out. I wouldn't expect netctl to perform exactly as netcfg did and perhaps netcfg's previous behaviour was more due to luck than design.

I suppose you are right, but I cannot leave the adapter plugged in all the time.  Maybe the better solution is to use acpid / udev to start netctl-ifplugd when the interface is detected.

Offline

#4 2014-01-14 20:32:29

hkluis
Member
Registered: 2014-01-14
Posts: 1

Re: netctl-ifplugd exits when USB NIC is unplugged

I too would like to see ifplugd remain running even if the interface disappears.  Isn't that what the "-M" is advertised to do, per help text:  "Don''t fail when the network interface is not available, instead use NETLINK to monitor device avaibility (sic). The is useful for PCMCIA devices and similar."  Indeed if you start "ifplugd -M" before plugging in the interface, ifplugd would monitor for the interface to appear.  It follows that if you unplug the interface, ifplugd should go back to waiting for it to appear.

I run into a similar scenario as noahsark1126. In my case, the USB subsystem can have its power be turned off and later on turned on.

Last edited by hkluis (2014-01-14 20:34:14)

Offline

#5 2014-01-15 18:40:47

noahsark1126
Member
Registered: 2008-08-28
Posts: 117

Re: netctl-ifplugd exits when USB NIC is unplugged

I am currently using the ifplugd daemon directly, outside of netctl.  I only have one wired network configuration so I don't need netctl profiles.  I just enabled 'ifplugd@eth0.service' and everything works as desired.

Offline

Board footer

Powered by FluxBB