Обновленный 16,04 серверов к 18.04.1, теперь я вижу странные ошибки о недостающих файлах, не удаваясь разрешить DNS, не удаваясь соединиться с шиной

Хорошо, таким образом, это - обновление от 16.04.1 LTS до 18.04.1 LTS, сервер является бездисплейным. После того, как обновление закончено, и перезагрузка завершается, следующее происходит:

Попытка к пакетам обновления только приводит к следующему:

~$ sudo apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  policykit-1 screen smartmontools
3 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 0 B/1,081 kB of archives.
After this operation, 147 kB of additional disk space will be used.
Do you want to continue? [Y/n] y

(Reading database ... 159133 files and directories currently installed.)
Preparing to unpack .../smartmontools_6.5+svn4324-1_amd64.deb ...
Failed to connect to bus: No such file or directory
[...]

Это - Dbus, о котором это говорит? Так или иначе, как насчет восстановления?

~$ sudo apt update
Err:1 http://security.ubuntu.com/ubuntu bionic-security InRelease
  Temporary failure resolving 'security.ubuntu.com'
Err:2 http://se.archive.ubuntu.com/ubuntu bionic InRelease
  Temporary failure resolving 'se.archive.ubuntu.com'
Err:3 http://se.archive.ubuntu.com/ubuntu bionic-updates InRelease
  Temporary failure resolving 'se.archive.ubuntu.com'
Err:4 http://se.archive.ubuntu.com/ubuntu bionic-backports InRelease
  Temporary failure resolving 'se.archive.ubuntu.com'
Reading package lists... Done
Building dependency tree
Reading state information... Done
1 package can be upgraded. Run 'apt list --upgradable' to see it.
W: Failed to fetch http://se.archive.ubuntu.com/ubuntu/dists/bionic/InRelease  Temporary failure resolving 'se.archive.ubuntu.com'
W: Failed to fetch http://se.archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease  Temporary failure resolving 'se.archive.ubuntu.com'
W: Failed to fetch http://se.archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease  Temporary failure resolving 'se.archive.ubuntu.com'
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/bionic-security/InRelease  Temporary failure resolving 'security.ubuntu.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.

Что? DNS повреждается?

~$ wget www.google.com
--2018-11-10 01:55:16--  http://www.google.com/
Resolving www.google.com (www.google.com)... failed: Temporary failure in name resolution.
wget: unable to resolve host address ‘www.google.com’

Похож на него. Хм, ifconfig не показывает DNS. Google направляет меня к этому вопросу, давайте попробуем его.

~$ systemd-resolve --status
sd_bus_open_system: No such file or directory

Хорошо, я все более потерян теперь. Google теперь находит этот вопрос, который является о докере, который не является моим случаем, но также и упоминает проблему, где systemd не является pid 1:

~$ ps aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.1  0.1 159752  9116 ?        Ss   01:25   0:02 /sbin/init splash nomdmonddf nomdmonisw
root         2  0.0  0.0      0     0 ?        S    01:25   0:00 [kthreadd]
root         3  0.0  0.0      0     0 ?        S    01:25   0:00 [ksoftirqd/0]
root         5  0.0  0.0      0     0 ?        S<   01:25   0:00 [kworker/0:0H]
root         7  0.0  0.0      0     0 ?        S    01:25   0:00 [rcu_sched]
root         8  0.0  0.0      0     0 ?        S    01:25   0:00 [rcu_bh]
root         9  0.0  0.0      0     0 ?        S    01:25   0:00 [migration/0]
root        10  0.0  0.0      0     0 ?        S    01:25   0:00 [watchdog/0]
root        11  0.0  0.0      0     0 ?        S    01:25   0:00 [watchdog/1]
[...]

Я предполагаю? Действительно ли это - корневая проблема или признак? Как я могу зафиксировать это?

1
задан 11 November 2018 в 23:52

1 ответ

У меня была та же ошибка на одном сервере OVH VPS после обновления до 18.04.01. У меня есть другие очень похожие серверы, хорошо работающие после обновления, которое помогло мне зафиксировать это.

Спустился по кроличьей норе и заметил:

sudo systemctl
...
systemd-logind.service     loaded failed failed
...

Которые приводят меня к этому сайту: https://forum.proxmox.com/threads/systemd-logind-failures.44219/

Я подтвердил, что мой/var/run не был sym, связанным с/, выполненным, и это было на других серверах. У этого были файлы в обоих местах.

Я symlinkd почти, как предложено, исправляя "каталог не пустые" ошибки в каждой строке с:

mv -f /var/run/sudo/ts/* /run/sudo/ts/; rm -rf /var/run/sudo/ts; 
mv -f /var/run/sudo/* /run/sudo/; rm -rf /var/run/sudo; 
mv -f /var/run/* /run/; rm -rf /var/run; 
ln -s /run /var/run;
reboot

Этот шаг решил части проблемы, такие как:

$ systemd-resolve --status

Но разрешение DNS все еще перестало работать, но хорошо работало с помощью твердости:

$ ping google.com
ping: google.com: Temporary failure in name resolution

$ systemd-resolve google.com
google.com: 216.58.213.174

Согласно предложению в https://superuser.com/questions/1317623/nslookup-failed-but-systemd-resolved-works

Я изменил свою/etc/resolv.conf символьную ссылку от /run/resolvconf/resolv.conf кому: /run/systemd/resolve/resolv.conf

$ ls -l /etc/resolv.conf
lrwxrwxrwx 1 root root 29 Feb 24  2017 /etc/resolv.conf -> ../run/resolvconf/resolv.conf

$ sudo rm /etc/resolv.conf
$ sudo ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf

$ ping google.com
PING google.com (216.58.204.238) 56(84) bytes of data.
64 bytes from par21s06-in-f14.1e100.net (216.58.204.238): icmp_seq=1 ttl=53 time=9.11 ms

Все работает теперь.

2
ответ дан 7 December 2019 в 13:20

Другие вопросы по тегам:

Похожие вопросы: