====== CentOS7 出現 slice User 訊息的解法 ======
* CentOS 7 的 /var/log/messages 系統紀錄內會大量出現 slice User 的訊息如下:
Aug 18 08:34:49 ct-squid systemd: Removed slice User Slice of root.
Aug 18 09:30:01 ct-squid systemd: Created slice User Slice of root.
Aug 18 09:30:01 ct-squid systemd: Started Session c616 of user root.
Aug 18 09:41:07 ct-squid systemd: Removed slice User Slice of root.
Aug 18 10:30:01 ct-squid systemd: Created slice User Slice of root.
Aug 18 10:30:01 ct-squid systemd: Started Session c617 of user root.
Aug 18 10:36:28 ct-squid systemd: Removed slice User Slice of root.
Aug 18 10:54:22 ct-squid systemd: Created slice User Slice of root.
Aug 18 10:54:22 ct-squid systemd: Started Session 33128 of user root.
Aug 18 10:54:22 ct-squid systemd-logind: New session 33128 of user root.
* 主要的原因是和 systemd 服務有關, 可以透過紀錄篩選規則設定, 來隱藏這些 slice User 訊息, 設定方式如下:
echo 'if $programname == "systemd" and ($msg contains "Starting Session" or $msg contains "Started Session" or $msg contains "Created slice" or $msg contains "Starting user-" or $msg contains "Starting User Slice of" or $msg contains "Removed session" or $msg contains "Removed slice User Slice of" or $msg contains "Stopping User Slice of") then stop' >/etc/rsyslog.d/ignore-systemd-session-slice.conf
systemctl restart rsyslog
===== 參考網址 =====
* https://access.redhat.com/solutions/1564823
{{tag>centos7}}