Wait for network linux

Start job is running for wait for network to be configured. Ubuntu server 18.04

I am receiving the message «Start job is running for wait for netowrk to be configured» during bootup. Computer hangs for 2 minutes until whatever is going on times out. Network connection appears to be there since there appears to be a successful synchronization to time ntp.ubuntu.com just prior to the hang. This is within VirtualBox, after setting Adapter 1 to NAT, Adapter 2 to Host-Only Adapter, and setting /etc/netplan/50-cloud-init.yaml as follows:

network: ethernets: enp0s3: addresses: [] dhcp4: true enp0s8: dhcp4: true version: 2 

(I’m new to netplan; admittedly I’m poking in the dark here). Reviewing syslog after bootup, here is what I see:

Nov 6 22:55:47 magnolia systemd-networkd[539]: enp0s3: Gained IPv6LL Nov 6 22:55:47 magnolia systemd-networkd[539]: enp0s3: Configured Nov 6 22:55:47 magnolia systemd-networkd-wait-online[546]: ignoring: lo Nov 6 22:55:47 magnolia systemd-networkd-wait-online[546]: managing: enp0s3 Nov 6 22:55:47 magnolia systemd-timesyncd[423]: Network configuration changed, trying to establish connection. Nov 6 22:55:47 magnolia systemd-networkd[539]: enp0s8: Gained IPv6LL Nov 6 22:55:47 magnolia systemd-timesyncd[423]: Synchronized to time server 91.189.89.199:123 (ntp.ubuntu.com). Nov 6 22:55:47 magnolia systemd-networkd-wait-online[546]: Event loop failed: Connection timed out Nov 6 22:55:47 magnolia systemd[1]: systemd-networkd-wait-online.service: Main process exited, code=exited, status=1/FAILURE Nov 6 22:55:47 magnolia systemd[1]: systemd-networkd-wait-online.service: Failed with result 'exit-code'. Nov 6 22:55:47 magnolia systemd[1]: Failed to start Wait for Network to be Configured. Nov 6 22:55:47 magnolia systemd[1]: Starting Initial cloud-init job (metadata service crawler). Nov 6 22:55:47 magnolia cloud-init[587]: Cloud-init v. 18.4-0ubuntu1~18.04.1 running 'init' at Tue, 06 Nov 2018 22:55:46 +0000. Up 128.51 seconds. Nov 6 22:55:47 magnolia cloud-init[587]: ci-info: ++++++++++++++++++++++++++++++++++++++Net device info+++++++++++++++++++++++++++++++++++++++ Nov 6 22:55:47 magnolia cloud-init[587]: ci-info: +--------+------+-----------------------------+---------------+--------+-------------------+ Nov 6 22:55:47 magnolia cloud-init[587]: ci-info: | Device | Up | Address | Mask | Scope | Hw-Address | Nov 6 22:55:47 magnolia cloud-init[587]: ci-info: +--------+------+-----------------------------+---------------+--------+-------------------+ Nov 6 22:55:47 magnolia cloud-init[587]: ci-info: | enp0s3 | True | 10.0.2.15 | 255.255.255.0 | global | 08:00:27:c9:60:26 | Nov 6 22:55:47 magnolia cloud-init[587]: ci-info: | enp0s3 | True | fe80::a00:27ff:fec9:6026/64 | . | link | 08:00:27:c9:60:26 | Nov 6 22:55:47 magnolia cloud-init[587]: ci-info: | enp0s8 | True | 192.168.56.105 | 255.255.255.0 | global | 08:00:27:41:62:12 | Nov 6 22:55:47 magnolia cloud-init[587]: ci-info: | enp0s8 | True | fe80::a00:27ff:fe41:6212/64 | . | link | 08:00:27:41:62:12 | Nov 6 22:55:47 magnolia cloud-init[587]: ci-info: | lo | True | 127.0.0.1 | 255.0.0.0 | host | . | Nov 6 22:55:47 magnolia cloud-init[587]: ci-info: | lo | True | ::1/128 | . | host | . | Nov 6 22:55:47 magnolia cloud-init[587]: ci-info: +--------+------+-----------------------------+---------------+--------+-------------------+ 

I find it curious the timestamp doesn’t reflect the 2 minute wait, but perhaps that’s another question. I found this other answer for Ubuntu 17, appears to be related: A start job is running for wait for network to be configured. Ubuntu server 17.10 and tried disabling systemd-networkd-wait-online.service as indicated but that does not appear to work (still get the 2 minute wait). Any ideas what’s going on here, and how to fix it?

Читайте также:  Удаление linux установка windows

Источник

Задержка при загрузке Ubuntu Server

Если сервер имеет два или более сетевых интерфейсов, то при загрузке можно столкнуться с зависанием на две-три минуты. При этом выдается сообщение «A start job is running for Wait for Network to be Configured». Например, у меня это случилось при настройке маршрутизатора с двумя сетевыми интерфейсами enp0s3 и enp0s8 .

Оказалось, что это служба systemd-networkd-wait-online ждет состояния «онлайн» для интерфейса enp0s8 :

$ sudo systemctl status systemd-networkd-wait-online.service ● systemd-networkd-wait-online.service - Wait for Network to be Configured Loaded: loaded (/lib/systemd/system/systemd-networkd-wait-online.service; enabled-runtime; vendor preset: enabled) Active: failed (Result: exit-code) since Fri 2020-04-24 14:38:46 MSK; 1min 50s ago Docs: man:systemd-networkd-wait-online.service(8) Process: 495 ExecStart=/lib/systemd/systemd-networkd-wait-online (code=exited, status=1/FAILURE) Main PID: 495 (code=exited, status=1/FAILURE) апр 15 14:36:46 gateway systemd[1]: Starting Wait for Network to be Configured. апр 15 14:38:46 gateway systemd-networkd-wait-online[495]: Event loop failed: Connection timed out апр 15 14:38:46 gateway systemd[1]: systemd-networkd-wait-online.service: Main process exited, code=exited, status=1/FAILURE апр 15 14:38:46 gateway systemd[1]: systemd-networkd-wait-online.service: Failed with result 'exit-code'. апр 15 14:38:46 gateway systemd[1]: Failed to start Wait for Network to be Configured.

Давайте скажем ей, чтобы ждала состояния «онлайн» только для интерфейса enp0s3 :

$ sudo systemctl edit systemd-networkd-wait-online.service

Эта команда создает в каталоге /etc/systemd/system/ новый каталог systemd-networkd-wait-online.service.d , помещает в него пустой файл override.conf и открывает этот файл на редактирование:

[Service] ExecStart= ExecStart=/lib/systemd/systemd-networkd-wait-online --interface=enp0s3

Мы отменили прежнюю директиву ExecStart , которая предписывала ждать состояния «онлайн» для всех интерфесов, и добавили вместо нее новую, которая предписывает ждать состояния «онлайн» для интерфейса enp0s3 . Теперь сообщаем системе, что мы внесли изменения в конфигурацию службы:

$ sudo systemctl daemon-reload

Вместо указания интерфейсов, для которых надо ждать состояния «онлайн», можно указать, какие интерфейсы игнорировать:

[Service] ExecStart= ExecStart=/lib/systemd/systemd-networkd-wait-online --ignore=enp0s8

По идее, есть еще один способ сказать, что не надо ждать состояния «онлайн» для интерфейса enp0s8 — в файле конфигурации Netplan :

network: version: 2 renderer: networkd ethernets: enp0s3: . optional: no enp0s8: . optional: yes

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

  • 1С:Предприятие (31)
  • API (29)
  • Bash (43)
  • CLI (99)
  • CMS (139)
  • CSS (50)
  • Frontend (75)
  • HTML (66)
  • JavaScript (150)
  • Laravel (72)
  • Linux (145)
  • MySQL (76)
  • PHP (125)
  • React.js (66)
  • SSH (27)
  • Ubuntu (68)
  • Web-разработка (509)
  • WordPress (73)
  • Yii2 (69)
  • БазаДанных (95)
  • Битрикс (66)
  • Блог (29)
  • Верстка (43)
  • ИнтернетМагаз… (84)
  • КаталогТоваров (87)
  • Класс (30)
  • Клиент (27)
  • Ключ (28)
  • Команда (68)
  • Компонент (60)
  • Конфигурация (61)
  • Корзина (32)
  • ЛокальнаяСеть (28)
  • Модуль (34)
  • Навигация (31)
  • Настройка (139)
  • ПанельУправле… (29)
  • Плагин (33)
  • Пользователь (26)
  • Практика (99)
  • Сервер (74)
  • Событие (27)
  • Теория (105)
  • Установка (66)
  • Файл (47)
  • Форма (58)
  • Фреймворк (192)
  • Функция (36)
  • ШаблонСайта (68)
Читайте также:  Python ide install linux

Источник

A start job is running for wait for network to be configured. Ubuntu server 20.04

After reading this post, I’ve followed this answer. But , when I edit the /etc/netplan/01-netcfg.yaml , it was blank. So I create that file and add optional: true . After sudo netplan apply , It turns out to be an error error in network definition unknown key ‘optional’ . Is the previous post answer still relevant for ubuntu 20.04? And he stated that:

00-installer-config.yaml 01-netcfg.yaml 

result of sudo lshw -C network as @heynnema requested as @heynnema requested and result of cat /etc/netplan/*.yaml
enter image description here

Please edit your question to show the result of the terminal command: ls /etc/netplan and also: cat /etc/netplan/01-netcfg.yaml

I order to help you, please edit your question and show me sudo lshw -C network and cat /etc/netplan/*.yaml . Did your Ubuntu Server install fail during the install?

@heynnema I’ve edited it. No. it didn’t fail at all. In VBox, Using NAT is ok, but I want to use bridged adapter now to make it fixed IP.

I just got this problem too, on a fresh install of Ubuntu Server 20.04. The server has two ethernet ports, and the ‘wait’ is because only one of them is connected to a network, therefore the second one is waiting for DHCP to occur for up to the two minute time limit. The answer from @heynnema below sorted this for me, i.e. I just added the optional: true setting for the unused ethernet port, ran ‘netplan generate’ and ‘netplan apply’, rebooted, and the long wait is now gone.

Источник

Wait for network linux

NAME

systemd-networkd-wait-online.service, systemd-networkd-wait-online - Wait for network to come online

SYNOPSIS

DESCRIPTION

systemd-networkd-wait-online is a oneshot system service (see systemd.service(5)), that waits for the network to be configured. By default, it will wait for all links it is aware of and which are managed by systemd-networkd.service(8) to be fully configured or failed, and for at least one link to be online. Here, online means that the link's operational state is equal or higher than "degraded". The threshold can be configured by --operational-state= option.

OPTIONS

The following options are understood: -i INTERFACE[:MIN_OPERSTATE[:MAX_OPERSTATE]], --interface=INTERFACE[:MIN_OPERSTATE[:MAX_OPERSTATE]] Network interface to wait for before deciding if the system is online. This is useful when a system has several interfaces which will be configured, but a particular one is necessary to access some network resources. When used, all other interfaces are ignored. This option may be used more than once to wait for multiple network interfaces. When this option is specified multiple times, then systemd-networkd-wait-online waits for all specified interfaces to be online. Optionally, required minimum and maximum operational states can be specified after a colon ":". Please see networkctl(1) for possible operational states. If the operational state is not specified here, then the value from RequiredForOnline= in the corresponding .network file is used if present, and "degraded" otherwise. --ignore=INTERFACE Network interfaces to be ignored when deciding if the system is online. By default, only the loopback interface is ignored. This option may be used more than once to ignore multiple network interfaces. -o MIN_OPERSTATE[:MAX_OPERSTATE], --operational-state=MIN_OPERSTATE[:MAX_OPERSTATE] Takes a minimum operational state and an optional maximum operational state. Please see networkctl(1) for possible operational states. If set, the specified value overrides RequiredForOnline= settings in .network files. But this does not override operational states specified in --interface= option. --any Even if several interfaces are in configuring state, systemd-networkd-wait-online exits with success when at least one interface becomes online. When this option is specified with --interface=, then systemd-networkd-wait-online waits for one of the specified interfaces to be online. This option is useful when some interfaces may not have carrier on boot. --timeout=SECS Fail the service if the network is not online by the time the timeout elapses. A timeout of 0 disables the timeout. Defaults to 120 seconds. -q, --quiet Suppress log messages. -h, --help Print a short help text and exit. --version Print a short version string and exit.

SEE ALSO

systemd(1), systemd.service(5), systemd-networkd.service(8), networkctl(1)

© 2019 Canonical Ltd. Ubuntu and Canonical are registered trademarks of Canonical Ltd.

Читайте также:  Копирование жестких дисков linux

Источник

Оцените статью
Adblock
detector