AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / unix / 问题 / 699245
Accepted
Estatistics
Estatistics
Asked: 2022-04-16 21:24:42 +0800 CST2022-04-16 21:24:42 +0800 CST 2022-04-16 21:24:42 +0800 CST

linux 的启动时间非常慢 - 如何改进

  • 772
sudo systemd-analyze
Startup finished in 35.729s (firmware) + 5.933s (loader) + 32.920s (kernel) + 3min 18.149s (userspace) = 4min 32.732s 
graphical.target reached after 2min 46.619s in userspace

和

systemd-analyze blame
1min 41.665s sendmail.service
1min 31.112s podman-auto-update.service
1min 19.116s [email protected]
1min 17.766s [email protected]
1min 17.311s [email protected]
     59.659s mpd.service
     37.709s [email protected]
     34.906s systemd-networkd-wait-online.service
     33.412s nmbd.service
     33.152s apache2.service
     30.795s lightdm.service
     30.746s plymouth-quit-wait.service
     29.475s vmware.service
     27.070s udisks2.service
     24.988s networkd-dispatcher.service
     23.200s accounts-daemon.service
     19.811s lxc-net.service
     15.702s upower.service
     14.965s avahi-daemon.service
     14.964s NetworkManager.service
     14.573s NetworkManager-wait-online.service
     14.191s polkit.service
     14.189s power-profiles-daemon.service
     14.022s switcheroo-control.service
     14.016s wpa_supplicant.service
     13.695s systemd-udev-settle.service
     13.529s systemd-logind.service
     13.513s vmware-USBArbitrator.service
     12.911s dev-sda2.device

系统信息

     ,g$$$$$$$$$$$$$$$P.        OS: Debian 11 bullseye
    ,g$$P""       """Y$$.".      Kernel: x86_64 Linux 5.11.0-18-generic
   ,$$P'              `$$$.      Uptime: 18m
  ',$$P       ,ggs.     `$$b:    Packages: 6057
  `d$$'     ,$P"'   .    $$$     Shell: bash
   $$P      d$'     ,    $$P     Resolution: 1920x1080
   $$:      $$.   -    ,d$$'     DE: KDE 5.80.0 / Plasma 5.21.4
   $$\;      Y$b._   _,d$P'      WM: KWin
   Y$$.    `.`"Y$$$$P"'          GTK Theme: Breeze [GTK2], Adwaita [GTK3]
   `$$b      "-.__               Icon Theme: breeze
    `Y$$                         Disk: 569G / 1.4T (44%)
     `Y$$.                       CPU: Intel Core i5-4570S @ 4x 3.6GHz [30.0°C]
       `$$b.                     GPU: NV138
         `Y$$b.                  RAM: 3043MiB / 7909MiB
            `"Y$b._             

我有 4 个硬盘通过 USB 集线器连接,2 个 USB 硬盘连接到 USB 端口。所有硬盘外部西方护照。但只有 on1 磁盘在引导时自动挂载。

我已经安装了 minisql(更快的 postgresql 替代品?)我将我的 android 手机连接到 pc。我有有线互联网。

a) sendmail 服务花了将近 2 分钟 - 我可以禁用吗?b) psotgresql 替代品?为什么是 3 个实例?c) 音乐网络的 mpd 服务非常慢。备择方案?

所以如果修复这些问题,我的启动时间可能会缩短 5 分钟!!!

任何想法?

更新:卸载 postgresql 后(我将来可能需要)

1min 33.326s sendmail.service
     58.872s podman-auto-update.service
     40.822s mpd.service
     33.722s systemd-networkd-wait-online.service
     29.988s [email protected]
     26.474s apache2.service
     26.234s lightdm.service
     26.217s plymouth-quit-wait.service
     25.138s vmware.service
     24.550s networkd-dispatcher.service
     23.020s udisks2.service
     22.879s accounts-daemon.service
     15.663s NetworkManager-wait-online.service
     14.961s avahi-daemon.service
     14.959s NetworkManager.service
     14.594s polkit.service
     14.592s power-profiles-daemon.service
     14.210s switcheroo-control.service
     14.203s wpa_supplicant.service

禁用 sendmail.service 后更新

55.560s podman-auto-update.service
42.642s mpd.service
33.696s systemd-networkd-wait-online.service
30.868s [email protected]
26.124s apache2.service
25.182s networkd-dispatcher.service
25.012s udisks2.service
23.658s lightdm.service
23.642s plymouth-quit-wait.service
22.550s vmware.service
22.424s accounts-daemon.service
16.712s systemd-journal-flush.service
16.003s NetworkManager-wait-online.service
15.687s systemd-udev-settle.service
15.422s avahi-daemon.service
15.420s NetworkManager.service
15.031s polkit.service
15.018s power-profiles-daemon.service
14.880s vmware-USBArbitrator.service
14.623s switcheroo-control.service
14.618s wpa_supplicant.service
14.145s winbind.service
14.015s lxc-net.service
13.885s systemd-logind.service
13.360s dev-sda2.device
10.786s ModemManager.service
10.315s smartmontools.service
10.246s gpu-manager.service
 9.491s systemd-networkd.service
 8.443s timidity.service
 8.324s smbd.service
 8.098s nmbd.service
 7.389s cups.service
 7.121s pwrstatd.service
 7.099s packagekit.service
 6.850s lxc.service
 5.758s rsyslog.service
 4.943s systemd-udevd.service
 4.324s systemd-modules-load.service
 4.090s gpm.service
 3.690s e2scrub_reap.service

更新:最担心的日记条目,因为它要求

Apr 16 01:50:19 eliasc kernel: platform eisa.0: EISA: Cannot allocate resource for mainboard
Apr 16 01:50:19 eliasc kernel: platform eisa.0: Cannot allocate resource for EISA slot 1
Apr 16 01:50:19 eliasc kernel: platform eisa.0: Cannot allocate resource for EISA slot 2
Apr 16 01:50:19 eliasc kernel: platform eisa.0: Cannot allocate resource for EISA slot 3
Apr 16 01:50:19 eliasc kernel: platform eisa.0: Cannot allocate resource for EISA slot 4
Apr 16 01:50:19 eliasc kernel: platform eisa.0: Cannot allocate resource for EISA slot 5
Apr 16 01:50:19 eliasc kernel: platform eisa.0: Cannot allocate resource for EISA slot 6
Apr 16 01:50:19 eliasc kernel: platform eisa.0: Cannot allocate resource for EISA slot 7
Apr 16 01:50:19 eliasc kernel: platform eisa.0: Cannot allocate resource for EISA slot 8

r8169 0000:03:00.0: can't disable ASPM; OS doesn't have ASPM control

Apr 16 01:50:19 eliasc kernel: ACPI Warning: SystemIO range 0x0000000000001828-0x000000000000182F conflicts with OpRegion 0x0000000000001800-0x000000000000187F (\>

Apr 16 01:50:19 eliasc kernel: lpc_ich: Resource conflict(s) found affecting gpio_ich

Apr 16 01:50:19 eliasc kernel: sd 7:0:0:0: [sdb] No Caching mode page found
Apr 16 01:50:19 eliasc kernel: sd 7:0:0:0: [sdb] Assuming drive cache: write through
Apr 16 01:50:19 eliasc kernel: sd 8:0:0:0: [sdc] No Caching mode page found
Apr 16 01:50:19 eliasc kernel: sd 8:0:0:0: [sdc] Assuming drive cache: write through
Apr 16 01:50:19 eliasc kernel: sd 9:0:0:0: [sdd] No Caching mode page found
Apr 16 01:50:19 eliasc kernel: sd 9:0:0:0: [sdd] Assuming drive cache: write through


Apr 16 01:50:19 eliasc systemd[1]: /lib/systemd/system/plymouth-start.service:16: Unit configured to use KillMode=none. This is unsafe, as it disables systemd's p>
Apr 16 01:50:20 eliasc kernel: ashmem_linux: module is from the staging directory, the quality is unknown, you have been warned.

Apr 16 01:50:22 eliasc systemd-modules-load[406]: Failed to find module 'dhd'

Apr 16 01:50:24 eliasc systemd-udevd[425]: /usr/lib/udev/rules.d/60-anbox-modules-dkms.rules:1 NAME="%k" is ignored, as it breaks kernel supplied names.

Apr 16 01:50:27 eliasc kernel: at24 0-0052: supply vcc not found, using dummy regulator

Apr 16 01:50:28 eliasc kernel: scsi 11:0:0:1: Wrong diagnostic page; asked for 1 got 8
Apr 16 01:50:28 eliasc kernel: scsi 11:0:0:1: Failed to get diagnostic page 0x1
Apr 16 01:50:28 eliasc kernel: scsi 11:0:0:1: Failed to bind enclosure -19

Apr 16 01:50:30 eliasc kernel: snd_hda_intel 0000:00:1b.0: dmic_detect option is deprecated, pass snd-intel-dspcfg.dsp_driver=1 option instead
Apr 16 01:50:30 eliasc kernel: snd_hda_intel 0000:01:00.1: dmic_detect option is deprecated, pass snd-intel-dspcfg.dsp_driver=1 option instead

Apr 16 01:50:42 eliasc smartd[750]: Device: /dev/sda [SAT], no ATA CHECK POWER STATUS support, ignoring -n Directive

Apr 16 01:51:11 eliasc kernel: vmmon: loading out-of-tree module taints kernel.

Configuration file /etc/xdg/autostart/org.kde.discover.notifier.desktop is marked executable. Please remove executable permission bits. Proceeding anyway.

Apr 16 01:51:37 eliasc systemd-xdg-autostart-generator[1373]: Not generating service for XDG autostart app-unity\x2dsettings\x2ddaemon-autostart.service, error parsing Exec= line: No such file or directory

Apr 16 01:51:42 eliasc systemd[1518]: mpd.socket: Failed to create listening socket ([::]:6600): Address already in use
Apr 16 01:51:42 eliasc systemd[1322]: mpd.socket: Failed to receive listening socket ([::]:6600): Input/output error
Apr 16 01:51:42 eliasc systemd[1322]: mpd.socket: Failed to listen on sockets: Input/output error
Apr 16 01:51:42 eliasc systemd[1322]: mpd.socket: Failed with result 'resources'.
Apr 16 01:51:42 eliasc systemd[1322]: Failed to listen on mpd.socket.

Apr 16 01:51:43 eliasc sm-mta[1533]: My unqualified host name (eliasc) unknown; sleeping for retry
Apr 16 01:51:44 eliasc sm-msp-queue[1549]: My unqualified host name (eliasc) unknown; sleeping for retry
Apr 16 01:51:46 eliasc systemd[1087]: mpd.service: Main process exited, code=exited, status=1/FAILURE
Apr 16 01:51:46 eliasc systemd[1087]: mpd.service: Failed with result 'exit-code'.
Apr 16 01:51:46 eliasc systemd[1087]: Failed to start Music Player Daemon.
Apr 16 01:51:46 eliasc systemd[1322]: mpd.service: Main process exited, code=exited, status=1/FAILURE
Apr 16 01:51:46 eliasc systemd[1322]: mpd.service: Failed with result 'exit-code'.

Apr 16 01:51:47 eliasc pipewire-media-session[1538]: RTKit error: org.freedesktop.DBus.Error.AccessDenied
Apr 16 01:51:47 eliasc pipewire-media-session[1538]: could not set nice-level to -11: Permission denied
Apr 16 01:51:47 eliasc pipewire[1537]: RTKit error: org.freedesktop.DBus.Error.AccessDenied
Apr 16 01:51:47 eliasc pipewire[1537]: could not set nice-level to -11: Permission denied
Apr 16 01:51:47 eliasc pipewire-media-session[1522]: RTKit error: org.freedesktop.DBus.Error.AccessDenied
Apr 16 01:51:47 eliasc pipewire-media-session[1522]: could not set nice-level to -11: Permission denied
Apr 16 01:51:47 eliasc pipewire[1521]: RTKit error: org.freedesktop.DBus.Error.AccessDenied
Apr 16 01:51:47 eliasc pipewire[1521]: could not set nice-level to -11: Permission denied

Apr 16 01:51:47 eliasc pipewire-media-session[1538]: RTKit error: org.freedesktop.DBus.Error.AccessDenied
Apr 16 01:51:47 eliasc pipewire-media-session[1538]: could not make thread realtime: Permission denied
Apr 16 01:51:47 eliasc pipewire[1537]: RTKit error: org.freedesktop.DBus.Error.AccessDenied
Apr 16 01:51:47 eliasc pipewire[1537]: could not make thread realtime: Permission denied
Apr 16 01:51:47 eliasc pipewire-media-session[1522]: RTKit error: org.freedesktop.DBus.Error.AccessDenied
Apr 16 01:51:47 eliasc pipewire-media-session[1522]: could not make thread realtime: Permission denied
Apr 16 01:51:47 eliasc pipewire[1521]: RTKit error: org.freedesktop.DBus.Error.AccessDenied
Apr 16 01:51:47 eliasc pipewire[1521]: could not make thread realtime: Permission denied
Apr 16 01:51:47 eliasc pulseaudio[1523]: Home directory not accessible: Permission denied

Apr 16 01:51:47 eliasc pulseaudio[1578]: Home directory not accessible: Permission denied
Apr 16 01:51:47 eliasc systemd[1322]: pulseaudio.service: Main process exited, code=exited, status=1/FAILURE
Apr 16 01:51:47 eliasc systemd[1322]: pulseaudio.service: Failed with result 'exit-code'.
Apr 16 01:51:47 eliasc systemd[1322]: Failed to start Sound Service
Apr 16 01:51:56 eliasc pulseaudio[1539]: Sink output does not exist.
Apr 16 01:51:56 eliasc pulseaudio[1539]: Source input does not exist.

Apr 16 01:52:43 eliasc sm-mta[1533]: unable to qualify my own domain name (eliasc) -- using short name
Apr 16 01:52:44 eliasc sm-msp-queue[1549]: unable to qualify my own domain name (eliasc) -- using short name

Apr 16 01:52:58 eliasc org.kde.powerdevil.backlighthelper[2031]: org.kde.powerdevil: no kernel backlight interface found

Apr 16 08:32:10 eliasc systemd[1087]: plasma-baloorunner.service: Failed with result 'exit-code'.
Apr 16 08:32:10 eliasc systemd[1087]: Failed to start KRunner provider for baloo file indexer.
systemd boot
  • 1 1 个回答
  • 1969 Views

1 个回答

  • Voted
  1. Best Answer
    NetIceGear
    2022-04-16T22:56:18+08:002022-04-16T22:56:18+08:00

    首先,我会推荐前面提到的systemd-analyze,而不是更详细地查看引导步骤sudo journalctl -b。此命令还将根据其重要性对行进行颜色编码(红色表示错误等)

    此外,journalctl您将能够分析多个以前的引导,所有这些都sudo journalctl --list-boots使用以下命令列出并访问它们的日志:

    journalctl -b [ID]
    
        [ID]                -1 for previous boot, -2 for two boots back etc. 
    

    至于sendmail.service,可能的原因是它无法解析您的主机名,直到超时并进入睡眠状态以允许引导继续。这将在journalctl -b日志中报告,可能如下所示:

    sendmail[1740]: My unqualified host name ([hostname]) unknown; sleeping for retry
    sendmail[1740]: unable to qualify my own domain name ([hostname]) -- using short name
    

    如果您检查以下位置

    ls -alh /var/lib/sendmail
    

    您可能会找到一个与此类似的文件:

    -rw-rw---- 1 root smmsp 11M Apr 16 02:01 /var/lib/sendmail/dead.letter
    

    如果你往里看,你/var/log/会发现mail.logmail.err

    我几乎可以保证你的mail.log文件会很大,但是有 3 行的序列一遍又一遍地重复,看起来像这样:

    Apr 12 16:01:04 [usr] sm-msp-queue[64338]: 23CK11C9064338: to=postmaster, delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=32831, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]
    Apr 12 16:01:04 [user] sm-msp-queue[64338]: 233NL1Ph021284: to=[user], delay=8+20:40:02, xdelay=00:00:00, mailer=relay, pri=121459, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]
    Apr 12 16:01:04 [user] sm-msp-queue[64338]: 233NL1Ph021284: 23CK11CA064338: return to sender: Cannot send message for 5 days
    

    鉴于您不确定sendmail它是什么或为什么运行,并且看到sendmail.service它给您带来的只是问题,因此可以安全地假设您没有积极使用它。在这种情况下,我建议禁用它,您可以使用以下方法:

    sudo systemctl disable sendmail
    

    重新启动,然后分析您的时间,让我们知道 1 分 40 秒的延迟是否不再存在。

    • 1

相关问题

  • 系统完好,grub坏了

  • 使用 systemd 看门狗支持重新启动应用程序

  • “pacman -Syu”“可能”破坏了我的系统,因为未安装引导

  • 克隆的 SSD 无法启动并打印奇怪的线条

  • 使用键盘快捷键启动/停止 systemd 服务 [关闭]

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    模块 i915 可能缺少固件 /lib/firmware/i915/*

    • 3 个回答
  • Marko Smith

    无法获取 jessie backports 存储库

    • 4 个回答
  • Marko Smith

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    user12345 无法获取 jessie backports 存储库 2019-03-27 04:39:28 +0800 CST
  • Martin Hope
    Carl 为什么大多数 systemd 示例都包含 WantedBy=multi-user.target? 2019-03-15 11:49:25 +0800 CST
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve