有馬総一郎のブログ

(彼氏の事情)

2023年01月19日 07:25:42 JST - 3 minute read - Comments - Linux

Debian11が起動時のネットワーク接続に時間がかかる

Debian11にKEDデスクトップ環境をインストールしたが、電源ONして起動するとネットワーク接続networking.serviceに時間がかかる。起動後、ネットワーク接続は、出来てはいるのだけど…

無関係だったけど、やってみた方法1

[SOLVED] Wifi networks detected but unable to connect on Debian 9.3

ln -s /dev/null /etc/systemd/network/99-default.link

意味なし。

無関係だったけど、やってみた方法2

[EDITED] firmware: failed to load iwl-debug-yoyo.bin (-2) - Debian User Forums

/etc/modeprobe.d/iwlwifi.conf

options iwlwifi enable_ini=N

作成してみたけど意味なし。

havegedエラーを解消したけど

何かhavegedがエラーになっている、これが原因か?

$ sudo systemctl status haveged.service
● haveged.service - Entropy Daemon based on the HAVEGE algorithm
     Loaded: loaded (/lib/systemd/system/haveged.service; enabled; vendor preset: enabled)
     Active: failed (Result: signal) since Sun 2022-12-25 08:39:57 JST; 13min ago
       Docs: man:haveged(8)
             http://www.issihosts.com/haveged/
    Process: 640 ExecStart=/usr/sbin/haveged --Foreground --verbose=1 $DAEMON_ARGS (code=killed, signal=SYS)
   Main PID: 640 (code=killed, signal=SYS)
        CPU: 35ms

12月 25 08:39:57 debian systemd[1]: haveged.service: Main process exited, code=killed, status=31/SYS
12月 25 08:39:57 debian systemd[1]: haveged.service: Failed with result 'signal'.
12月 25 08:39:57 debian systemd[1]: haveged.service: Scheduled restart job, restart counter is at 5.
12月 25 08:39:57 debian systemd[1]: Stopped Entropy Daemon based on the HAVEGE algorithm.
12月 25 08:39:57 debian systemd[1]: haveged.service: Start request repeated too quickly.
12月 25 08:39:57 debian systemd[1]: haveged.service: Failed with result 'signal'.
12月 25 08:39:57 debian systemd[1]: Failed to start Entropy Daemon based on the HAVEGE algorithm.

Failed to start Entropy Daemon based on the HAVEGE algorithm on boot · Issue #63 · jirka-h/haveged · GitHub

このissueを元にhaveged.serviceを修正。

sudo systemctl edit haveged.service

[Service]
CapabilityBoundingSet=CAP_SYS_ADMIN CAP_SYS_CHROOT
PrivateTmp=false
SystemCallFilter=
SystemCallFilter=

つまりは、以下を行った。

  • set PrivateTmp=false
  • update CapabilityBoundingSet=CAP_SYS_ADMIN CAP_SYS_CHROOT
  • Please try firt to comment out both SystemCallFilter
$ sudo systemctl daemon-reload          
$ sudo systemctl restart haveged.service
$ sudo systemctl status haveged.service 
● haveged.service - Entropy Daemon based on the HAVEGE algorithm
     Loaded: loaded (/lib/systemd/system/haveged.service; enabled; vendor preset: enabled)
    Drop-In: /etc/systemd/system/haveged.service.d
             └─override.conf
     Active: active (running) since Sun 2022-12-25 19:20:20 JST; 1s ago
       Docs: man:haveged(8)
             http://www.issihosts.com/haveged/
   Main PID: 6086 (haveged)
      Tasks: 1 (limit: 18999)
     Memory: 5.0M
        CPU: 239ms
     CGroup: /system.slice/haveged.service
             └─6086 /usr/sbin/haveged --Foreground --verbose=1

12月 25 19:20:20 debian systemd[1]: Started Entropy Daemon based on the HAVEGE algorithm.
12月 25 19:20:21 debian haveged[6086]: haveged: command socket is listening at fd 3
12月 25 19:20:21 debian haveged[6086]: haveged: ver: 1.9.14; arch: x86; vend: GenuineIntel; build: (gcc 10.2.1 ITV); collect: 128K
12月 25 19:20:21 debian haveged[6086]: haveged: cpu: (L4 VC); data: 32K (L4 V); inst: 32K (L4 V); idx: 24/40; sz: 32154/54019
12月 25 19:20:21 debian haveged[6086]: haveged: tot tests(BA8): A:1/1 B:1/1 continuous tests(B):  last entropy estimate 7.99882
12月 25 19:20:21 debian haveged[6086]: haveged: fills: 0, generated: 0

エラー解消。だけど意味なし。

タイムアウトの時間を短くする

linux networking - Debian - Slow boot waiting for network - Server Fault

sudo systemctl edit networking.serviceをしてタイムアウトの時間を短くしたら、確かに起動時間は短くなったけど、起動後、ネットワーク接続されなくなってしまった。sudo ifup wlp2s0すれば接続されるが…

[Service]
TimeoutStartSec=5sec

/etc/network/interfaces.d/setupが原因

答えはここに→ debian — 起動Debian 9エラー:「Raiseネットワークインターフェースの起動に失敗しました」

/etc/network/interfaces.d/setupがあるせいで、まずそれno(有線)接続を試みるようになってしまっているためだった。バカすぎる…確認。

$ ls /etc/network/interfaces.d/
setup
$ cat /etc/network/interfaces.d/setup
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp
$

sudoedit /etc/network/interfacesをしてsource /etc/network/interfaces.d/をコメントアウトした。

- source /etc/network/interfaces.d/*
+ # source /etc/network/interfaces.d/*

以上、解決。

Tags: Debian

Debian11をインストールしてKDEデスクトップを導入する Airsonic(Subsonic)からNavidromeに乗り換える。

comments powered by Disqus