How to troubleshoot Systemd service startup ordering issues

本文介绍如何通过systemd-bootchart服务获取精确的服务启动时间和顺序,以解决在Red Hat Enterprise Linux 7.3+环境中确定服务实际启动顺序的问题。通过启用并重启系统,可以生成SVG图像,清晰展示毫秒级的系统服务启动过程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

https://access.redhat.com/solutions/2988611

 SOLUTION 已验证 - 已更新 2017年七月13日02:53 - 

English 

环境

  • Red Hat Enterprise Linux 7.3+
    • Systemd

问题

  • What command can I use to determine the "literal/actual" start-up sequence of service units (get date/time) and/or
    which log files should I check?
  • I know I can use systemd-analyze to get dependency info, but I want to know that actual start-up times/order/logs
    of specific services.

决议

1) Enable the "systemd-bootchart" service.

Raw

    # systemctl enable systemd-bootchart

2) Restart the system.

Raw

    # systemctl reboot

3) Review the resulting /run/log/bootchart*.svg file for the boot process to verify ordering of service startup.

Raw

    # systemctl status systemd-bootchart -l
    ● systemd-bootchart.service - Boot Process Profiler
       Loaded: loaded (/usr/lib/systemd/system/systemd-bootchart.service; enabled; vendor preset: disabled)
       Active: inactive (dead) since Fri 2017-03-31 11:23:05 EDT; 3s ago
         Docs: man:systemd-bootchart.service(1)
           man:bootchart.conf(5)
      Process: 468 ExecStart=/usr/lib/systemd/systemd-bootchart -r (code=exited, status=0/SUCCESS)
     Main PID: 468 (code=exited, status=0/SUCCESS)

    Mar 31 11:23:05 host.example.com systemd-bootchart[468]: Bootchart created: /run/log/bootchart-20170331-1122.svg
    Mar 31 11:23:05 host.example.com systemd-bootchart[468]: systemd-bootchart wrote /run/log/bootchart-20170331-1122.svg

Should further assistance be needed, please open a case with Red Hat support and provide the following:

  • A full description of the issue being encountered
  • sosreport of the system
  • The resulting bootchart-*.svg file

根源

When attempting to implement an ordering dependency within Systemd services, the exact ordering of operations can be difficult to infer. The system logs generally provide timestamps related to the operation, but can be difficult to decipher. The systemd-bootchart utility yields a Scalable Vector Graphic (SVG) image that yields millisecond resolution of system services.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值