Search This Blog

Saturday, January 2, 2016

RHEL7 - Configure a Persistent Systemd Journal


In this exercise, you learn how to make the journald journal permanent.

1.    1.    Open a root shell and type mkdir /var/log/journal .

[root@server1 /]# mkdir -p /var/log/journal

2. Before journald can write the journal to this directory, you have to set ownership.
Type chown root:systemd-journal /var/log/journal , followed by chmod 2755 /var/log/journal .

[root@server1 /]# chown root:systemd-journal /var/log/journal
[root@server1 /]# chmod 2755 /var/log/journal

3. Next, you can either reboot your system (restarting the systemd-journald service is not enough) or use the killall -USR1 systemd-journald command.

[root@server1 /]# killall -USR1 systemd-journald

4. The systemd journal is now persistent across reboots. If you want to see the log messages since last reboot, use journalctl -b .

[root@server1 /]# journalctl -b
-- Logs begin at Fri 2016-01-01 10:21:47 CET, end at Sat 2016-01-02 04:35:05 CET. --
Jan 01 10:21:47 rhelserver1.example.com systemd-journal[335]: Runtime journal is using 8.0M (max 141.7M, leaving 212.6M of free 1.3G, curren
Jan 01 10:21:47 rhelserver1.example.com systemd-journal[335]: Runtime journal is using 8.0M (max 141.7M, leaving 212.6M of free 1.3G, curren
Jan 01 10:21:47 rhelserver1.example.com kernel: Initializing cgroup subsys cpuset
Jan 01 10:21:47 rhelserver1.example.com kernel: Initializing cgroup subsys cpu
Jan 01 10:21:47 rhelserver1.example.com kernel: Initializing cgroup subsys cpuacct

[root@server1 /]# ls /var/log/journal
27739d9d19814b4eae2ddeaed745cea6



Thank you for reading.
For Reading other article, visit to “https://sites.google.com/site/unixwikis/

No comments:

Post a Comment