12

I am getting "Created slice user-0.slice." and "Starting Session 2025 of user root." in /var/log/messages in CentOS 7.  Can someone explain what they are?

[root@bew /]# tail -f /var/log/messages
May 26 21:20:01 bew systemd: Created slice user-0.slice.
May 26 21:20:01 bew systemd: Starting Session 2025 of user root.
May 26 21:20:01 bew systemd: Started Session 2025 of user root.
May 26 22:22:33 bew systemd: Stopping System Logging Service...
May 26 22:22:33 bew systemd: Starting System Logging Service...
May 26 22:22:33 bew systemd: Started System Logging Service.
May 26 22:30:01 bew systemd: Created slice user-0.slice.
May 26 22:30:01 bew systemd: Starting Session 2026 of user root.
May 26 22:30:01 bew systemd: Started Session 2026 of user root.
marbew
  • 121

2 Answers2

5

These are low priority "info"-level messages related to session and resource management. You can avoid them via

# systemd-analyze set-log-level notice
Jawa
  • 3,679
2

According to Red Hat,

These messages are normal and expected -- they will be seen any time a user logs in or e.g. a cron job is executed for the user.

If you don’t want to see these messages, Red Hat propose an alternate solution to prevent them from being logged while still keeping other info-level messages from the systemd service:

  1. Modify rsyslog to create a discard filter by running the following command:

     echo 'if $programname == "systemd" and ($msg contains "Starting Session" or $msg contains "Started Session" or $msg contains "Created slice" or $msg contains "Starting user-") then stop' >/etc/rsyslog.d/ignore-systemd-session-slice.conf
    
  2. Restart the rsyslog service:

     systemctl restart rsyslog