systemd 計時器單元啟動其他幾個服務

systemd 計時器單元啟動其他幾個服務

我有一個 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.servicesystemd-boot-system-token.servicesystemd-hwdb-update.servicesystemd-journal-catalog-update.servicesystemd-machine-id-commit.servicesystemd-sysusers.servicesystemd-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

相關內容