【问题标题】:Debugging systemctl "inactive (dead)"调试 systemctl "inactive (dead)"
【发布时间】:2021-08-03 06:52:07
【问题描述】:

我想确定为什么systemd-timesyncd 拒绝在启动时启动而不记录任何内容或在systemctl status 中提供有用信息。

# systemctl status systemd-timesyncd
* systemd-timesyncd.service - Network Time Synchronization
   Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man:systemd-timesyncd.service(8)

可以采取哪些步骤来确定一般情况下的问题是什么?

【问题讨论】:

    标签: systemd ntp systemctl


    【解决方案1】:

    在阅读了大量优秀的 man 文件并将服务的重复版本一分为二之后(这总是“神秘地工作”,回想起来并不神秘)。

    我发现有一个未提及的Conficts=... systemd-timesyncd.servicevboxadd-service.service

    日志中没有任何提示(根据https://github.com/systemd/systemd/issues/7104 推测systemd.log_level=debug 在这里会有所帮助)。

    我只能通过检查输出来注意到冲突

    systemd-analyze dot systemd-timesyncd.service
    

    这提供了冲突的暗示。

    一般来说,您可以使用

    列出所有冲突的服务
    # systemd-analyze dot systemd-timesyncd.service 2>/dev/null | grep red
        "systemd-timesyncd.service"->"shutdown.target" [color="red"];
        "vboxadd-service.service"->"systemd-timesyncd.service" [color="red"];
    

    或类似的命令

    # systemctl show '*' -p Id,Conflicts | grep -B1 '^Conflicts=.*systemd-timesyncd' | sed -n 's/^Id=//p'
    vboxadd-service.service
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-07-09
      • 2018-07-13
      • 2023-03-30
      • 2015-05-29
      • 2017-05-09
      • 1970-01-01
      • 2012-12-08
      相关资源
      最近更新 更多