You are not logged in.

#1 2013-08-13 03:13:28

Ownaginatious
Member
Registered: 2010-08-28
Posts: 60

Is there a way to make netctl-ifplugd try harder?

So on three computers running Arch now, I've come to realize that netctl-ifplugd is not very reliable at startup. On startup, it runs my default ethernet-dhcp profile, times out (maybe a bug? 3 completely different networks...), and then never tries again... leaving my connection down. This happens maybe every 1 in 3 restarts, and is particularly annoying if I'm restarting the machine over SSH. If I restart the service using systemctl, everything usually connects fine.

So my question is, is there a way to make netctl-ifplugd maybe try a few times rather than once before giving up? I'm not sure if this is something I would need to configure in that particular service, or in systemd.

Any help would be appreciated.

Offline

#2 2013-08-13 05:50:50

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: Is there a way to make netctl-ifplugd try harder?

If you are using dhcp, I imagine that if you simply set the dhcpcd timeout to 0 or something much higher, then this would make "netctl-ifplugd" try harder.

Out of curiousity, if you are using dhcp, why not just use dhcpcd@.service (or even just dhcpcd.service if that is the only network interface?


Edit: I just realized I'm an idiot... no I already knew that.  I realized that it is obvious that you are using dhcp, since you are using the 'ethernet-dhcp' example profile.

Last edited by WonderWoofy (2013-08-13 19:13:49)

Offline

#3 2013-08-13 06:56:29

rufus
Banned
From: san francisco
Registered: 2013-04-20
Posts: 153

Re: Is there a way to make netctl-ifplugd try harder?

Ownaginatious take a good look at the netctl wiki if you wrote or added a profile ie;ethernet-dhcp and started it via netctl/systemctl
   you may have misswrote it and/or didnt stop the profile that shipped with ifplug. I havnt had issues... if it starts fine did you enable it?
     check out wots loading    $systemctl list-units --type=service


end ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     'the machine is not the end to the means., we are. In history, in board rooms and politic the greatest  decision and effort
        evolves from passion, lust for life, and a common sense of humanity. Never forget what you are and why'.         -me

Offline

#4 2013-08-13 19:08:46

MoonSwan
Member
From: Great White North
Registered: 2008-01-23
Posts: 881

Re: Is there a way to make netctl-ifplugd try harder?

As well, if the name of your profile really is "ethernet-dhcp" you should rename it to something without a hyphen in it as netctl treats hyphenated services/targets/whatever in a different manner than non-hyphenated items.

Offline

#5 2013-08-14 01:49:57

Ownaginatious
Member
Registered: 2010-08-28
Posts: 60

Re: Is there a way to make netctl-ifplugd try harder?

MoonSwan wrote:

As well, if the name of your profile really is "ethernet-dhcp" you should rename it to something without a hyphen in it as netctl treats hyphenated services/targets/whatever in a different manner than non-hyphenated items.

I couldn't find anything in reference to this, do you perhaps have a link that describes how it handles hyphenated profiles?

Also, I'm not sure increasing the timeout would help. After restarting the service, I get a response almost immediately from my router... which leads me to believe some error occurs with sending out the DHCP request from the computer, or receiving it. I think just having the service try again would work better hmm

Offline

#6 2013-08-14 02:33:41

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: Is there a way to make netctl-ifplugd try harder?

It sounds like a race condition.  That is, the interface is not yet up before the service gets started and times out.

I use dhcpcd@.service that is launched by a udev rule.  It is basically just ripped off from the archiso's 80-dhcpcd.rules file that does the same thing.  This ensures that the dhcpcd@<interface>.service is started when the interface is ready and with the right interface name specified.  It is much simpler that way. 

Otherwise, you could try putting the ethernet card's module in the initramfs to be loaded super early, or you could specify it to be loaded early by including it in /etc/modules-load.d.

I guess you could also use a udev rule to launch the netctl-ifplugd@.service as well.  But if this machine is plugged in all the time, you probably don't need netctl-ifplugd.

Offline

#7 2013-08-15 22:13:55

kuroppo
Member
Registered: 2013-08-15
Posts: 2

Re: Is there a way to make netctl-ifplugd try harder?

I had the same problem that Ownaginatious does, with a fresh install and using dhcp.  After reading MoonSwan's response I checked my profiles, and the filenames contained hyphens.  I renamed my profiles, and I don't know why, but that seems to have fixed the problem (my connection was was down 2/3 of the time.  Since I renamed the profiles, my connection has started up for 5 restarts).

Last edited by kuroppo (2013-08-15 22:15:59)

Offline

#8 2013-08-15 23:17:12

kuroppo
Member
Registered: 2013-08-15
Posts: 2

Re: Is there a way to make netctl-ifplugd try harder?

Ownaginatious wrote:
MoonSwan wrote:

As well, if the name of your profile really is "ethernet-dhcp" you should rename it to something without a hyphen in it as netctl treats hyphenated services/targets/whatever in a different manner than non-hyphenated items.

I couldn't find anything in reference to this, do you perhaps have a link that describes how it handles hyphenated profiles?

I haven't found anything either, and I'm curious to know how this all works.

Offline

#9 2013-08-22 23:27:35

j_r0dd
Member
Registered: 2012-06-19
Posts: 4

Re: Is there a way to make netctl-ifplugd try harder?

MoonSwan wrote:

As well, if the name of your profile really is "ethernet-dhcp" you should rename it to something without a hyphen in it as netctl treats hyphenated services/targets/whatever in a different manner than non-hyphenated items.

I'm interested to know why netctl would have an issue with hyphenated file names when that's what wifi-menu uses when it generates profiles. Some of the sample profiles also have hyphenated names. O_o

Last edited by j_r0dd (2013-08-23 00:09:49)

Offline

#10 2013-08-23 15:35:26

anonymous_user
Member
Registered: 2009-08-28
Posts: 3,059

Re: Is there a way to make netctl-ifplugd try harder?

I believe its because systemd treats hyphens a special way:

https://bbs.archlinux.org/viewtopic.php … 7#p1268907

Offline

#11 2013-08-27 02:32:26

j_r0dd
Member
Registered: 2012-06-19
Posts: 4

Re: Is there a way to make netctl-ifplugd try harder?

For me loading the modules early on boot fixed the connection issue on boot. My problem now is if I plug in the ethernet after the fact, I have to either bounce the interface or the netctl-ifplugd service to pull an ip. This is basic functionality. The netctl-auto for my wifi works great with hyphenated profile names and all. This ifplugd makes me want to drop kick my pc. Does anybody know if the priority flag carries weight across every type of profile? One would assume hard-wired would always take priority over wifi.

Last edited by j_r0dd (2013-08-27 14:49:51)

Offline

#12 2013-08-28 01:09:27

thenewguy
Member
Registered: 2013-08-13
Posts: 6

Re: Is there a way to make netctl-ifplugd try harder?

j_r0dd wrote:

I'm interested to know why netctl would have an issue with hyphenated file names when that's what wifi-menu uses when it generates profiles. Some of the sample profiles also have hyphenated names. O_o

i had this problem as well. if there's a problem with hyphens in the file name, the example files shouldn't have hyphens.

Offline

Board footer

Powered by FluxBB