You are not logged in.

#1 2015-01-16 14:52:02

zorggy
Member
Registered: 2013-05-30
Posts: 26

[SOLVED] Two difficulties with systemd

Hello,

I have a two difficulties with systemd.

Startup:
According to the 'systemd-analyse blame' command, each service start in less than 200ms except dhcpcd: dhcpcd@eno1.service = 12s. Is it usual with Gigabit Ethernet to get a so slow network startup?

Kerberos:
My logging in process is local, but I added the pam-krb5 package (from AUR) to get a remote Kerberos authentication at the same time. Unfortunately it does not work every time: It's good if I wait few seconds before logging in and I suppose it is due to the slow network startup. So I would like to run the Display Manager (sddm) only after network is up. To configure it, I copied /usr/lib/systemd/system/sddm.service to /etc/systemd/system/sddm.service and I modified the copy:

[Unit]
Description=Simple Desktop Display Manager
Documentation=man:sddm(1) man:sddm.conf(5)
Conflicts=getty@tty1.service
Wants=network-online.target   ### line added
After=systemd-user-sessions.service getty@tty1.service plymouth-quit.service network-online.target ### last target added

[Service]
ExecStart=/usr/bin/sddm
Restart=always
#PrivateTmp=yes

[Install]
Alias=display-manager.service

But there is no change: sddm starts straight on without waiting for the network. What did I do wrong?

Last edited by zorggy (2015-01-16 21:10:04)

Offline

#2 2015-01-16 15:04:38

Awebb
Member
Registered: 2010-05-06
Posts: 6,688

Re: [SOLVED] Two difficulties with systemd

Startup: Try ditching dhcpcd and replacing it with systemd-networkd. If it still sucks, your network might have an issue.

Another thing: Disable the dhcpcd service and run it manually after the system is up and running. Then run blame. Is it faster now? If yes, you have the same problem I have, something blocks dhcpcd in relatively early boot. Ditching it for systemd-networkd will not fix this entirely, but reduce it from 12s to 1s (or so, on my setup).

Offline

#3 2015-01-16 15:57:14

zorggy
Member
Registered: 2013-05-30
Posts: 26

Re: [SOLVED] Two difficulties with systemd

So I moved to systemd-networkd and... it did not work as I did not configure at all the service. Finally there is only one little file to create, /etc/systemd/network/dhcp.network:

[Match]                                                                                                                                                             
Name=en*                                                                                                                                                            
                                                                                                                                                                    
[Network]                                                                                                                                                           
DHCP=v4

and it worked. After disabling dhcpcd@eno1 and enabling the new service and a reboot, I get only 34ms to start the service. Wow, fantastic! Thank you very much, Awebb.

Finally I don't need to delay the Display Manager, but if somebody can point out what I did wrong, I would learn another thing.

Offline

#4 2015-01-16 16:28:00

bstaletic
Member
Registered: 2014-02-02
Posts: 658

Re: [SOLVED] Two difficulties with systemd

You did nothing wrong, dhcpcd is just slow. Don't know about dhclient. Networkd is the fastest.

Remember to mark thread as solved.

Offline

#5 2015-01-16 16:32:50

Awebb
Member
Registered: 2010-05-06
Posts: 6,688

Re: [SOLVED] Two difficulties with systemd

You did nothing wrong. If you go through my posts of the past few days (search for dhcpcd), you will find that I recently came across the same thing.

EDIT: https://bbs.archlinux.org/viewtopic.php?id=192186

bstaletic wrote:

Remember to mark thread as solved.

Old Talaxian proverb: He, who has second question, must count the dots on his hand first.

Last edited by Awebb (2015-01-16 16:33:31)

Offline

#6 2015-01-16 16:49:20

gaelic
Member
Registered: 2010-08-01
Posts: 126

Re: [SOLVED] Two difficulties with systemd

My guess is that dhcpcd tries to get also a v6 Adress but runs into a timeout ...

Offline

#7 2015-01-17 23:55:51

gnubeest
Member
Registered: 2014-04-19
Posts: 8

Re: [SOLVED] Two difficulties with systemd

Technically the answer is to add

noarp

to your dhcpcd config. It will significantly improve the time it takes to get an IP.

But yes, networkd.

Offline

Board footer

Powered by FluxBB