You are not logged in.

#1 2013-06-23 21:34:50

Artifère
Member
Registered: 2011-11-12
Posts: 10

[SOLVED] NetworkManager startup is slow

Hi everyone!
I post here because I tried to speed up my Arch a little bit, and the systemd-analyze tool made me realize that NetworkManager was taking about 10s, that is half my boot time. But I don't understand why it takes so much time. Or, more precisely, why it needs to connect to a network before I'm logged in. I searched on the web, found several topics dealing with the topic but it didn't help: I use dhcpcd and not dhclient for instance.

So I tried some things, among which remove the "--no-daemon" option in the .service file. And it somewhat worked! Now the boot time reported by systemd-analyze is half what it used to be. But I have to wait for about 10 seconds after entering my password to get logged in.

So is there a way to telle systemd that I don't want to wait for NM to finish its business before giving me access to my session?

Thanks in advance,
Alexandre

Last edited by Artifère (2013-06-23 23:46:34)

Offline

#2 2013-06-23 21:47:33

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] NetworkManager startup is slow

Offline

#3 2013-06-23 22:17:11

Artifère
Member
Registered: 2011-11-12
Posts: 10

Re: [SOLVED] NetworkManager startup is slow

Thank you for your quick answer. In the first thread, if it is about connman, it does not seem to support openvpn... and I need openvpn in some cases It is the same for wicd mentioned in the second thread. I had wicd before I needed openvpn to work.

But is it normal that started as a daemon, nm prevent me from completing the logging process?

Offline

#4 2013-06-23 23:07:49

Max-P
Member
Registered: 2011-06-11
Posts: 164

Re: [SOLVED] NetworkManager startup is slow

Do you have anything that requires network to start? systemd boots the system by dependencies and will start as many processes in parallel as possible, so if your login manager waits for NetworkManager then it must depend on network(.target ?) and wait for NetworkManager to finish.

Can you give more details on your setup? What do you have at boot? Which login manager? It looks like systemd does the right thing since you still can't login until connected, you should probably focus more on what needs the network and block it than why NM takes so much time to connect.

Offline

#5 2013-06-23 23:41:50

Artifère
Member
Registered: 2011-11-12
Posts: 10

Re: [SOLVED] NetworkManager startup is slow

Oh! Thank you very much, that was exactly what I was looking for. In fact it turned out that multi-user had NM in its .wants directory... so I removed it from there, and now NM takes 5ms to load, everything is ok, and when I log in I just wait for xfce to load.

To answer your question, I log in via the basic tty.

So thank you again :-)

Last edited by Artifère (2013-06-23 23:46:10)

Offline

#6 2013-06-24 00:49:42

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

Re: [SOLVED] NetworkManager startup is slow

I am not sure what just happened in this thread... it would seem that Antifere found a solution, but I 'm not sure what was in the ".wants" directory that solved the problem.  FWIW, I evaluated the things I have at startup and realized that I have nothing that was totally dependent on having the network fully connected upon boot, so I simply masked the networkmanager-wait-online.service.  This seems to work just fine for me.  Alternatively, you could just remove the symlink from the multi-user.target wants directory.

Offline

#7 2013-06-24 01:25:44

Artifère
Member
Registered: 2011-11-12
Posts: 10

Re: [SOLVED] NetworkManager startup is slow

In fact, I did not know how dependencies were managed with systemd. So in the multi-user.target.wants directory, there was a symlink to Network Manager (and deluged). Since I did not see why they were here, I removed them. So now, multi-user doesn't wait for networkmanager to finish to start. But I did not have the network-manager-wait-online.service enabled.

Is this clearer now?

Offline

#8 2014-12-26 14:56:10

baqtor
Member
Registered: 2014-03-27
Posts: 4

Re: [SOLVED] NetworkManager startup is slow

What you should do is:

# rm /etc/systemd/system/multi-user.target.wants/NetworkManager.service

Last edited by baqtor (2014-12-26 14:56:39)

Offline

#9 2014-12-26 19:10:51

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] NetworkManager startup is slow

Please don't necrobump, particularly solved threads: https://wiki.archlinux.org/index.php/Fo … Bumping.27


Closing


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

Board footer

Powered by FluxBB