Centos

augenrules 什麼時候在 CentOS 7.1 上自動執行?

  • October 31, 2015

我需要更新 /etc/audit/audit.rules。我會替換文件重新啟動服務,但我在日誌中發現在機器初始啟動期間呼叫了 augenrules。

除了初次啟動,augenrules 是否有任何時候自動執行?

答案在/etc/systemd/system/multi-user.target.wants/auditd.service

[Service]
ExecStart=/sbin/auditd -n
## To not use augenrules, copy this file to /etc/systemd/system/auditd.service
## and comment/delete the next line and uncomment the auditctl line.
## NOTE: augenrules expect any rules to be added to /etc/audit/rules.d/
ExecStartPost=-/sbin/augenrules --load
#ExecStartPost=-/sbin/auditctl -R /etc/audit/audit.rules
ExecReload=/bin/kill -HUP $MAINPID

所以啟動服務會呼叫 augenrules。請注意,該服務僅在伺服器啟動時啟動。

引用自:https://serverfault.com/questions/732639