为了在某些磁盘上生成指标,我设置了systemd.timer + systemd.service
该计时器每 10 秒旋转一次,我想避免每次这个小脚本生成然后成功时我的日记都被垃圾邮件。
日记这样写多行
Jan 04 17:21:31 hostname systemd[1]: personal.service: Succeeded.
-- Subject: Unit succeeded
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- The unit personal.service has successfully entered the 'dead' state.
Run Code Online (Sandbox Code Playgroud)
此外,每次服务启动都会进行审核
Jan 04 17:22:31 hostname audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=personal comm="systemd" exe="/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Jan 04 17:22:31 hostname kernel: audit: type=1131 audit(1578158551.035:11612): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=personal comm="systemd" exe="/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Run Code Online (Sandbox Code Playgroud)