Ubuntu Server 16.04.3 - 无限启动

Ubuntu Server 16.04.3 - 无限启动

我的 Ubuntu Server 机器的启动时间非常长,仅用于 Zimbra 邮件服务器。

我对文件系统没有太多经验(没有),而且由于服务器是远程的(住房,只有 ssh 访问),我不想造成无法弥补的损害。

因此,尽管在发布这个问题之前做了大量研究,我还是问你。

下面我会尽可能多地告诉你信息

这是发布信息

Distributor ID: Ubuntu
Description:    Ubuntu 16.04.3 LTS
Release:        16.04
Codename:       xenial

我的dmseg(在“热点”处)

[   13.483425] r8169 0000:01:00.0 eth0: link down
[   13.483428] r8169 0000:01:00.0 eth0: link down
[   15.208227] r8169 0000:01:00.0 eth0: link up
[  299.864155] mce: [Hardware Error]: Machine check events logged
[  322.367057] cgroup: new mount options do not match the existing superblock, will be ignored
[  323.270765] ipmi message handler version 39.2
[  323.306618] IPMI System Interface driver.
[  323.306657] ipmi_si: Adding default-specified kcs state machine
[  323.306663] ipmi_si: Trying default-specified kcs state machine at i/o address 0xca2, slave address 0x0, irq 0
[  323.306673] ipmi_si: Interface detection failed
[  323.325508] ipmi_si: Adding default-specified smic state machine
[  323.325537] ipmi_si: Trying default-specified smic state machine at i/o address 0xca9, slave address 0x0, irq 0
[  323.325551] ipmi_si: Interface detection failed
[  323.337949] ipmi_si: Adding default-specified bt state machine
[  323.337959] ipmi_si: Trying default-specified bt state machine at i/o address 0xe4, slave address 0x0, irq 0
[  323.337975] ipmi_si: Interface detection failed
[  323.366265] ipmi_si: Unable to find any System Interface(s)
[  324.297495] audit_printk_skb: 12 callbacks suppressed
[  324.297502] audit: type=1400 audit(1556873113.607:16): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/1355/status" pid=1355 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=108 ouid=108
[  324.297578] audit: type=1400 audit(1556873113.607:17): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=1355 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=108 ouid=0
[  324.297681] audit: type=1400 audit(1556873113.607:18): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/1355/status" pid=1355 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=108 ouid=108
[ 2351.028248] perf interrupt took too long (2511 > 2500), lowering kernel.perf_event_max_sample_rate to 50000

问题的核心就在这里……

[  299.864155] mce: [Hardware Error]: Machine check events logged
[  322.367057] cgroup: new mount options do not match the existing superblock, will be ignored

...和这里

[ 2351.028248] perf interrupt took too long (2511 > 2500), lowering kernel.perf_event_max_sample_rate to 50000

很明显,至少在第一种情况下,这是文件系统的一些问题

这是我的systemd-analyze critical-chain

graphical.target @8min 12.557s
└─multi-user.target @8min 12.557s
  └─zimbra.service @5min 17.228s +2min 55.328s
    └─cron.service @5min 17.225s
      └─basic.target @5min 16.399s
        └─sockets.target @5min 16.399s
          └─snapd.socket @5min 16.396s +1ms
            └─sysinit.target @5min 16.344s
              └─systemd-update-utmp.service @5min 16.285s +55ms
                └─systemd-tmpfiles-setup.service @6.628s +5min 9.643s
                  └─local-fs.target @6.601s
                    └─run-user-999.mount @5min 17.509s
                      └─local-fs-pre.target @3.439s
                        └─systemd-remount-fs.service @3.365s +57ms
                          └─systemd-journald.socket @1.507s
                            └─-.mount @1.470s
                              └─system.slice @1.505s
                                └─-.slice @1.470s

出于“重量”的原因,我们必须排除zimbra.service,因为作为一个相当重的软件,可以合理地假设它需要很长时间才能启动。

然后我将对此进行分析systemd-tmpfiles-setup.service @6.628s +5min 9.643s,并进行 Google 搜索,我得到了几个讨论文件系统的结果。

以下是我的blkid

/dev/sda2: UUID="6f78f8e3-eb96-40ab-9fcf-83efe036ed85" TYPE="ext3" PARTUUID="bf518064-20ce-4355-8c91-6f2c7bfb0a09"
/dev/sda3: UUID="43d915cf-4be9-4930-b0cc-8b17856d7940" TYPE="ext3" PARTUUID="34b75fdd-36e0-4620-bdb4-5073d25a1397"
/dev/sda4: TYPE="swap" PARTUUID="b35559dd-07ee-46d9-aea5-addd0aa16c51"
/dev/sda1: PARTUUID="1b8c2ffe-1ef7-481c-a479-b0b72611a377"

和我的cat /etc/fstab

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda3 during installation
/dev/sda3 /               ext3    errors=remount-ro 0       1
# /boot was on /dev/sda2 during installation
/dev/sda2 /boot           ext3    defaults        0       2
# swap was on /dev/sda4 during installation
/dev/sda4 none            swap    sw              0       0

我要做一点笔记。由于空间原因,我不得不删除旧版本,否则我无法进行任何 apt-get 安装。我不知道这是否导致了问题,但这是我在系统上执行的唯一主要操作。

然而,我对“煮熟后食用”的解决方案不感兴趣,因为我负担不起测试费用。相反,我感兴趣的是根据提供的信息了解是什么导致了这种近乎无限的启动

谢谢

===============================================

编辑

正如 heynnema 所建议的,这里的结果grep -i -B 10 -A 10 mce /var/log/syslog*

    /var/log/syslog-May  3 10:45:11 webmail kernel: [    0.030147] Initializing cgroup subsys net_cls
/var/log/syslog-May  3 10:45:11 webmail systemd[1]: Reached target System Initialization.
/var/log/syslog-May  3 10:45:11 webmail kernel: [    0.030151] Initializing cgroup subsys perf_event
/var/log/syslog-May  3 10:45:11 webmail kernel: [    0.030156] Initializing cgroup subsys net_prio
/var/log/syslog-May  3 10:45:11 webmail kernel: [    0.030164] Initializing cgroup subsys hugetlb
/var/log/syslog-May  3 10:45:11 webmail kernel: [    0.030168] Initializing cgroup subsys pids
/var/log/syslog-May  3 10:45:11 webmail kernel: [    0.030243] CPU: Physical Processor ID: 0
/var/log/syslog-May  3 10:45:11 webmail systemd[1]: Listening on UUID daemon activation socket.
/var/log/syslog-May  3 10:45:11 webmail kernel: [    0.030246] CPU: Processor Core ID: 0
/var/log/syslog-May  3 10:45:11 webmail kernel: [    0.030253] FEATURE SPEC_CTRL Not Present
/var/log/syslog:May  3 10:45:11 webmail kernel: [    0.042007] mce: CPU supports 7 MCE banks
/var/log/syslog-May  3 10:45:11 webmail kernel: [    0.042085] CPU0: Thermal monitoring enabled (TM1)
/var/log/syslog-May  3 10:45:11 webmail kernel: [    0.042133] process: using mwait in idle threads
/var/log/syslog-May  3 10:45:11 webmail kernel: [    0.042139] Last level iTLB entries: 4KB 48, 2MB 0, 4MB 0
/var/log/syslog-May  3 10:45:11 webmail systemd[1]: Started Daily Cleanup of Temporary Directories.
/var/log/syslog-May  3 10:45:11 webmail kernel: [    0.042141] Last level dTLB entries: 4KB 0, 2MB 0, 4MB 0, 1GB 0
/var/log/syslog-May  3 10:45:11 webmail kernel: [    0.042145] Spectre V2 mitigation: Mitigation: Full generic retpoline
/var/log/syslog-May  3 10:45:11 webmail kernel: [    0.042148] Spectre V2 mitigation: Speculation control IBPB not-supported IBRS not-supported
/var/log/syslog-May  3 10:45:11 webmail kernel: [    0.044907] Freeing SMP alternatives memory: 32K
/var/log/syslog-May  3 10:45:11 webmail kernel: [    0.058017] ftrace: allocating 32202 entries in 126 pages
/var/log/syslog-May  3 10:45:11 webmail kernel: [    0.135915] smpboot: APIC(0) Converting physical 0 to logical package 0
--
/var/log/syslog-May  3 10:45:11 webmail kernel: [   13.135896] audit: type=1400 audit(1556872802.974:5): apparmor="STATUS" operation="profile_load" profile="unconfined" name="lxc-container-default-with-mounting" pid=889 comm="apparmor_parser"
/var/log/syslog-May  3 10:45:11 webmail kernel: [   13.135905] audit: type=1400 audit(1556872802.974:6): apparmor="STATUS" operation="profile_load" profile="unconfined" name="lxc-container-default-with-nesting" pid=889 comm="apparmor_parser"
/var/log/syslog-May  3 10:45:11 webmail kernel: [   13.139747] audit: type=1400 audit(1556872802.978:7): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/snapd/snap-confine" pid=893 comm="apparmor_parser"
/var/log/syslog-May  3 10:45:11 webmail kernel: [   13.139768] audit: type=1400 audit(1556872802.978:8): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/snapd/snap-confine//mount-namespace-capture-helper" pid=893 comm="apparmor_parser"
/var/log/syslog-May  3 10:45:11 webmail kernel: [   13.148187] audit: type=1400 audit(1556872802.986:9): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/lxd/lxd-bridge-proxy" pid=892 comm="apparmor_parser"
/var/log/syslog-May  3 10:45:11 webmail kernel: [   13.151918] audit: type=1400 audit(1556872802.990:10): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/sbin/tcpdump" pid=896 comm="apparmor_parser"
/var/log/syslog-May  3 10:45:11 webmail kernel: [   13.194174] audit: type=1400 audit(1556872803.034:11): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/sbin/mysqld" pid=894 comm="apparmor_parser"
/var/log/syslog-May  3 10:45:11 webmail kernel: [   13.483425] r8169 0000:01:00.0 eth0: link down
/var/log/syslog-May  3 10:45:11 webmail kernel: [   13.483428] r8169 0000:01:00.0 eth0: link down
/var/log/syslog-May  3 10:45:11 webmail kernel: [   15.208227] r8169 0000:01:00.0 eth0: link up
/var/log/syslog:May  3 10:45:11 webmail kernel: [  299.864155] mce: [Hardware Error]: Machine check events logged
/var/log/syslog-May  3 10:45:11 webmail kernel: [  322.367057] cgroup: new mount options do not match the existing superblock, will be ignored
/var/log/syslog-May  3 10:45:12 webmail dnsmasq[1085]: dnsmasq: syntax check OK.
/var/log/syslog-May  3 10:45:12 webmail dbus[1133]: [system] AppArmor D-Bus mediation is enabled
/var/log/syslog-May  3 10:45:12 webmail systemd[1]: Starting vsftpd FTP server...
/var/log/syslog-May  3 10:45:12 webmail systemd[1]: Starting LSB: OpenIPMI Driver init script...
/var/log/syslog-May  3 10:45:12 webmail systemd[1]: Started Regular background program processing daemon.
/var/log/syslog-May  3 10:45:12 webmail systemd[1]: Starting LSB: Zimbra mail service...
/var/log/syslog-May  3 10:45:12 webmail cron[1157]: (CRON) INFO (pidfile fd = 3)
/var/log/syslog-May  3 10:45:12 webmail systemd[1]: Starting LSB: MD monitoring daemon...
/var/log/syslog-May  3 10:45:12 webmail systemd[1]: Starting MySQL Community Server...
Binary file /var/log/syslog.5.gz matches

相关内容