我有一个 systemd 计时器,每 5 秒启动一个关联单元。这按预期工作(它会向日志发送垃圾邮件,但这是另一个问题),但它显然还启动了一些其他通常不应启动的 systemd 单元。这些是我的单位文件:
/etc/system.d/system/make_temps.service
[Unit]
Description=Puts all the temperatures in one file
[Service]
LogLevelMax=6
Environment=SYSTEMD_LOG_LEVEL=debug
Type=oneshot
ExecStart=/usr/local/bin/make_temps
/etc/systemd/system/make_temps.timer
[Unit]
Description=Timer for unit putting the temperatures in one file
[Timer]
OnActiveSec=0sec
OnUnitActiveSec=5sec
AccuracySec=500msec
[Install]
WantedBy=timers.target
我用它来为另一个程序准备一个文件: 思凡。我提供这些信息只是为了确定,尽管我认为这并不重要。
当我使用journalctl检查日志时,我得到以下输出:
Apr 06 20:40:59 t490 systemd[1]: Condition check resulted in First Boot Wizard being skipped.
Apr 06 20:40:59 t490 systemd[1]: Condition check resulted in File System Check on Root Device being skipped.
Apr 06 20:40:59 t490 systemd[1]: Condition check resulted in Rebuild Dynamic Linker Cache being skipped.
Apr 06 20:40:59 t490 systemd[1]: Condition check resulted in Store a System Token in an EFI Variable being skipped.
Apr 06 20:40:59 t490 systemd[1]: Condition check resulted in Rebuild Hardware Database being skipped.
Apr 06 20:40:59 t490 systemd[1]: Condition check resulted in Rebuild Journal Catalog being skipped.
Apr 06 20:40:59 t490 systemd[1]: Condition check resulted in Commit a transient machine-id on disk being skipped.
Apr 06 20:40:59 t490 systemd[1]: Condition check resulted in Create System Users being skipped.
Apr 06 20:40:59 t490 systemd[1]: Condition check resulted in Update is Completed being skipped.
Apr 06 20:40:59 t490 systemd[1]: Starting Puts all the temperatures in one file...
Apr 06 20:40:59 t490 systemd[1]: make_temps.service: Succeeded.
Apr 06 20:40:59 t490 systemd[1]: Finished Puts all the temperatures in one file.
Apr 06 20:40:59 t490 audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=make_temps comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Apr 06 20:40:59 t490 audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=make_temps comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Apr 06 20:40:59 t490 kernel: audit: type=1130 audit(1586198459.428:1369): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=make_temps comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Apr 06 20:40:59 t490 kernel: audit: type=1131 audit(1586198459.428:1370): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=make_temps comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
为什么 服务
systemd-firstboot.service
、、、、、、、、、、 启动 ?
systemd-fsck-root.service
ldconfig.service
systemd-boot-system-token.service
systemd-hwdb-update.service
systemd-journal-catalog-update.service
systemd-machine-id-commit.service
systemd-sysusers.service
systemd-update-done.service
不得不说,这些信息并不是每次都会出现,而是几乎每次都会出现。我认为它相关的原因是,在我的其他系统上,这些消息不会出现(因为我不使用这些单元),并且当我停止计时器单元时,其他服务也不会被触发。我不知道为什么会发生这种情况,并且非常感谢每一个提示。
我在内核上使用 Arch Linux 5.5.13-arch2-1
,我的 systemd 版本是:
systemd 245 (245.4-2-arch) +PAM +AUDIT -SELINUX -IMA -APPARMOR +SMACK -SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=hybrid
如果我可以提供任何其他信息,或者这不是发布此信息的正确位置,请告诉我。
答案1
这是来自 Arch 论坛,可能相关 - 不是一个解决方案,除非熵问题,然后也许是解决方案。https://bbs.archlinux.org/viewtopic.php?id=253767