D.W*_*.W. 5 fedora logs systemd
查看我的系统日志,我看到以下消息/var/log/messages:
Sep 2 15:29:15 <myhostname> systemd[1]: Requested transaction contradicts existing jobs: File exists
Run Code Online (Sandbox Code Playgroud)
所以,我的问题是:如何解决此错误?我应该采取什么步骤来理解这意味着什么,是什么导致了它,是否需要担心,如果是,如何纠正它?
而且,“请求的交易与现有的工作相矛盾”消息是什么意思?我怀疑一定有我缺少的概念背景。在任何情况下,此错误消息是否建议一些候选的后续步骤来诊断此错误消息的原因并了解导致它的原因?
我已经阅读了 systemd 文档,但我没有发现它们对此有帮助。最好有一个关于寻找什么的一般指南:我怀疑这可能对那些也经历过“......与现有工作相矛盾”消息的其他人有所帮助。
要获取有关此错误的更多信息以进行故障排除,请首先运行以下命令:
$ journalctl -ab
Run Code Online (Sandbox Code Playgroud)
这将从 systemd 日志中转储一些详细日志。
此外,在该错误的正前方可能还有另一个错误,告诉您具体是哪个服务出现了问题。也尝试诊断该服务(以firewalld为例):
$ systemctl status firewalld.service
Run Code Online (Sandbox Code Playgroud)
具体来说,该行来自用于事务激活的 systemd 代码:
http://cgit.freedesktop.org/systemd/systemd/commit/?id=75778e21dfeee51036d24501e39ea7398fabe502
具体来说,对于 systemd 事务(来自 man systemd):
systemd has a minimal transaction system: if a unit is requested to start up
or shut down it will add it and all its dependencies to a temporary
transaction. Then, it will verify if the transaction is consistent (i.e.
whether the ordering of all units is cycle-free). If it is not, systemd will
try to fix it up, and removes non-essential jobs from the transaction that
might remove the loop. Also, systemd tries to suppress non-essential jobs in
the transaction that would stop a running service. Finally it is checked
whether the jobs of the transaction contradict jobs that have already been
queued, and optionally the transaction is aborted then. If all worked out and
the transaction is consistent and minimized in its impact it is merged with
all already outstanding jobs and added to the run queue. Effectively this
means that before executing a requested operation, systemd will verify that
it makes sense, fixing it if possible, and only failing if it really cannot
work.
Run Code Online (Sandbox Code Playgroud)
因此,将所有这些结合在一起,我猜测在该日志条目附近还有其他东西正在尝试启动,但已经有一个锁定文件(可能已过时)需要清理。