You are not logged in.

#1 2021-01-04 15:48:47

beroal
Member
From: Ukraine
Registered: 2009-06-07
Posts: 384
Website

slow boot because of a network adapter

Hi. Since I connected a Wi-Fi USB dongle to my desktop, the boot time became very long. The dongle is EDUP AC1200 2.4 GHz / 5 GHz with the Realtek RTL8812BU chipset (driver).

$ systemd-analyze time
Startup finished in 10.614s (firmware) + 111ms (loader) + 4.629s (kernel) + 31.849s (userspace) = 47.205s 
graphical.target reached after 31.787s in userspace
$ systemd-analyze critical-chain
graphical.target @31.787s
└─multi-user.target @31.787s
  └─ntpd.service @31.452s +334ms
    └─network.target @31.443s
      └─netctl@wifiap.service @17.437s +14.005s
        └─sys-subsystem-net-devices-wifiap.device @17.435s
$ systemd-analyze plot

0.svg

If I disable the network profile for the dongle, the boot time is much shorter, as shown below.

$ systemd-analyze time
Startup finished in 10.629s (firmware) + 112ms (loader) + 4.634s (kernel) + 3.989s (userspace) = 19.365s 
graphical.target reached after 3.944s in userspace
$ systemd-analyze critical-chain
graphical.target @3.944s
└─multi-user.target @3.944s
  └─ntpd.service @3.606s +338ms
    └─network.target @3.601s
      └─netctl@uplink.service @1.582s +2.018s
        └─network-pre.target @1.581s
          └─iptables.service @1.488s +92ms
            └─basic.target @1.482s
              └─sockets.target @1.482s
                └─dbus.socket @1.482s
                  └─sysinit.target @1.478s
                    └─systemd-update-utmp.service @1.468s +10ms
                      └─systemd-tmpfiles-setup.service @1.437s +29ms
                        └─local-fs.target @1.436s
                          └─srv-ftp-data\x2dtranslate.mount @1.416s +19ms
                            └─mnt-data.mount @717ms +506ms
                              └─systemd-fsck@dev-disk-by\x2did-ata\x2dSAMSUNG_HD204UI_S2H7JD2B228091\x2dpart1.service @698ms +17ms
                                └─local-fs-pre.target @696ms
                                  └─lvm2-monitor.service @253ms +443ms
                                    └─lvm2-lvmetad.service @346ms
                                      └─systemd-udevd.service @297ms +47ms
                                        └─systemd-tmpfiles-setup-dev.service @275ms +21ms
                                          └─kmod-static-nodes.service @252ms +14ms
                                            └─systemd-journald.socket @247ms
                                              └─-.mount @236ms
                                                └─-.slice @236ms
$ systemd-analyze plot

1.svg

I suppose that the dongle requires a lot of time to boot because of the hardware. The thing is, a user can start working without the network being up. I noticed that `lightdm.service` depends on `systemd-user-sessions.service` and removed `network.target` from `After` from the unit file `systemd-user-sessions.service`:

$ cat /etc/systemd/system/systemd-user-sessions.service
[Unit]
Description=Permit User Sessions
Documentation=man:systemd-user-sessions.service(8)
After=remote-fs.target nss-user-lookup.target home.mount

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/lib/systemd/systemd-user-sessions start
ExecStop=/usr/lib/systemd/systemd-user-sessions stop

Now `lightdm.service` starts much earlier, as shown below.

$ systemd-analyze time
Startup finished in 10.464s (firmware) + 111ms (loader) + 4.658s (kernel) + 32.029s (userspace) = 47.264s 
graphical.target reached after 31.966s in userspace
$ systemd-analyze critical-chain
graphical.target @31.966s
└─multi-user.target @31.966s
  └─ntpd.service @31.531s +434ms
    └─network.target @31.521s
      └─netctl@wifiap.service @17.524s +13.996s
        └─sys-subsystem-net-devices-wifiap.device @17.522s
$ systemd-analyze plot

2.svg

$ cat /etc/hostapd/hostapd.conf
# Wireless Interface
driver=nl80211
interface=wifiap
logger_syslog=-1
logger_syslog_level=2
logger_stdout=-1
logger_stdout_level=2

# Wireless Environment
country_code=UA
country3=0x49
ieee80211d=1
ieee80211h=1
ieee80211n=1
ieee80211ac=1
hw_mode=a
ht_capab=[HT40+][SHORT-GI-20][SHORT-GI-40][DSSS_CCK-40][MAX-AMSDU-3839]
vht_capab=[MAX-MPDU-3895][SHORT-GI-80][SU-BEAMFORMEE]
vht_oper_chwidth=1
channel=149
vht_oper_centr_freq_seg0_idx=155
ssid={skipped}

# Authentication and Encryption
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase={skipped}
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP CCMP
rsn_pairwise=CCMP
$ cat /etc/netctl/wifiap
Connection=ethernet
Interface=wifiap
SkipNoCarrier=yes
IP=static
Address=('192.168.42.161/28')

My questions are:

  • Is this solution okay? I changed a system file about whose purpose I have no idea.

  • Is it possible to speed up the dongle?

Last edited by beroal (2021-01-04 16:02:50)


we are not condemned to write ugly code

Offline

#2 2021-01-05 13:56:57

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,383

Re: slow boot because of a network adapter

archwiki on Software_access_point#Wi-Fi_link_layer wrote:

Also make sure that the interface is not managed by a network manager.

A software access point is usually configured to let your system provide network access to other devices.
Is that really what you want ?

If yes, check https://wiki.archlinux.org/index.php/So … figuration


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#3 2021-01-05 15:12:42

beroal
Member
From: Ukraine
Registered: 2009-06-07
Posts: 384
Website

Re: slow boot because of a network adapter

Lone_Wolf wrote:

A software access point is usually configured to let your system provide network access to other devices.
Is that really what you want?

Yes, the dongle creates a home Wi-Fi network.


we are not condemned to write ugly code

Offline

#4 2021-01-06 10:57:20

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,383

Re: slow boot because of a network adapter

First, disable & remove the netctl profile, also restore the lightdm service file .

2nd :
Is the dongle to be used by the desktop AND the home network ?

If yes, you need to setup a network bridge .

If not you'll  need to setup  NAT .


see the link at the bottom of post #2 to find relevant wiki pages.

(see link at boottm in post #2).


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#5 2021-01-06 11:11:18

Ropid
Member
Registered: 2015-03-09
Posts: 1,069

Re: slow boot because of a network adapter

About the service file you worry about:

The other network manager tools are set up differently compared to netctl. They will reach network.target immediately and won't hold up lightdm.service. You could check out "systemd-networkd" as an alternative to netctl and see if you like it. systemd-networkd is installed already because it's part of systemd.

Offline

Board footer

Powered by FluxBB