You are not logged in.

#1 2013-06-06 10:38:03

Ovion
Member
Registered: 2013-02-24
Posts: 78

[solved] put enabled netctl-profiles on boot to background

Hi,
I want to speed up my boot-process and that mainly means I have to deal with netctl (as I'm using that for networking):

I'm logging into my account via console login and I have a netctl-profile enabled to be started on boot (a simple wired connection, I want to have network when I'm at home without dealing with it manually), but I'm not reliant on have a network connection on boot.
So I would like to have netctl do the networking stuff in the background, instead of having the console login waiting for netctl to finish (so it seems).

The boot-process is accelerated heavily if I disable the netctl profile (netctl uses more than a half of the entire time userspace needs for booting), so I would like to get the console login while netctl is still working on the connection (especially when I'm not at home with my computer, so the connection is damned to fail but still takes time). Userspace might technically not boot faster then, but from the user's perspective it does, as the time netctl uses is approximately the time I need to type login and password.

I haven't found an adequate option for the profile in the manpage netctl.profile nor on the netclt-manpage nor in the wiki nor somewhere else.
Writing a custom service-file won't be a problem. I tried that, though, but that didn't solve the problem, console login is also delayed this way, but that might be due to not having used the right options in the service-file.

If anyone has an idea how to archive this I would be glad to hear about. (I hope my post wasn't too confusing. smile)

Thanks!

Last edited by Ovion (2013-06-09 20:29:49)

Offline

#2 2013-06-08 17:16:58

Tmn
Member
Registered: 2013-05-29
Posts: 13

Re: [solved] put enabled netctl-profiles on boot to background

You could probably use the ip command in the .xinitrc if you don't mind the network connection starting as soon as your WM/DE starts

ip addr add 192.168.1.2/24 dev eth0
ip route add default via 192.168.1.1

Offline

#3 2013-06-08 18:58:08

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

Re: [solved] put enabled netctl-profiles on boot to background

If you use the netctl@.service (this is what happens if you use "netctl enable <profile>") then it will fully wait for an IP before the network.target is reached.  If you use netctl-auto@.service then it will complete the network.target once it has loaded all the profiles that don't have "ExcludeAuto=yes".  This is because netctl-auto is meant to be used as a service with proper roaming support.  So it assumes that you won't absolutely be in range of a profiled network when it starts, so it just loads the potential configurations and then reports completion.

To use netctl-auto, I think you will also need to ensure you have wpa_actiond installed as well.  If you only really have one configuration that you want it to potentially connect to on boot, then just put "ExcludeAuto=yes" into all the other profiles. If when you start the netctl-auto service (whether on boot or otherwise) and it is in range of more than one available profile, you can use "Priority=<#>" to ensure that it will connect to the network you want.  This is particularly useful if you use a dual-band router with two different SSIDs.

Offline

#4 2013-06-09 11:58:58

Ovion
Member
Registered: 2013-02-24
Posts: 78

Re: [solved] put enabled netctl-profiles on boot to background

@Tmn
Doesn't work for me as it needs root-privileges.

@WonderWoofy
I have one simple wired dhcp profile that doesn't contain "ExcludeAuto=yes" now, but with netctl-auto@.service enabled it does not connect this profile on boot, I have to do it manually (in contrast to that "netctl enable wired" works) and it takes its time before the login is shown.

I also hat the idea that the network waits for an ip (via dhcp) before showing the login (according to the journal). That would be the thing I would like to have been done in the background. Can I convince netctl to do so?

Edit: Switched to a static IP-Adress, which halved the time netctl delays login, but I would still like to have it switch to background or something like this. I assume that would require to have network.target reached after console login?

Last edited by Ovion (2013-06-09 12:28:23)

Offline

#5 2013-06-09 13:43:58

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

Re: [solved] put enabled netctl-profiles on boot to background

Ah, I assumed you were using a wireless network, which is why I told you to use netctl-auto. In that case, you need to enable netctl-ifplugd@<interface>.service.  These can only be started by using "netctl-auto start <interface>" so you don't have to type out long strigns of text to just test it out.  It has completion and everything (at least in zsh).

See the netctl wiki page.  It is a wealth of information.

Offline

#6 2013-06-09 15:48:53

Ovion
Member
Registered: 2013-02-24
Posts: 78

Re: [solved] put enabled netctl-profiles on boot to background

Oh, sorry, I was unprecise about the network type.

systemctl enable netctl-ifplugd@myeth.service

did the trick, thanks a lot!

I'm just wondering how the profile is chosen. According to journalctl all profiles are read (in an order which isn't obvious, at least not alphabetically) and the first ethernet-profile read is used (which is the dhcp-one). Can I influence which profile is used (assumed I have more than one wired-profile)? Haven't found anything on the manpage concerning this, neither on the wiki or somewhere else.

Offline

#7 2013-06-09 20:05:26

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

Re: [solved] put enabled netctl-profiles on boot to background

How many wired connection profiles do you have?  I have never actually set this up, so I am unsure about how it decides to parse the profiles and in what order.  As far as wireless is concerned, there is the Priority= configuration parameter, but with netctl-ifplug, I don't think there is anything.  I don't know that the netctl wired functionality is even meant to have more than one profile, but rather it is meant to only active the profile when needed.

Edit: Don't forget to mark the thread as [Solved] which can be done by editing the first post.

Last edited by WonderWoofy (2013-06-09 20:05:53)

Offline

#8 2013-06-09 20:40:49

Ovion
Member
Registered: 2013-02-24
Posts: 78

Re: [solved] put enabled netctl-profiles on boot to background

WonderWoofy wrote:

How many wired connection profiles do you have?

At the moment two, one set up with dhcp, one with static ip, to be honest as a result of my experiments, but I could definitely imagine a situation where I have a wired dhcp-connection at home and a wired connection with static ip at my office or two static-ip-setups, routing, whatever. So I think there is definitely the possibility to be in need of more than one wired profile.
I admit these are quite special situations, nevertheless...

WonderWoofy wrote:

Don't forget to mark the thread as [Solved] which can be done by editing the first post.

Done, thanks for the reminder. I tend to forget that.^^'

Offline

Board footer

Powered by FluxBB