Tuesday, November 2, 2021

[SOLVED] How to troubleshoot empty /var/log/secure /var/log/messages etc log on linux

Issue

Today(2016-12-14), i login my vps and cat /var/log/secure /var/log/messages, but all these log files are empty except *-20161211. I don't know what happen. How to fix it? I need help, thanks!

Here is my screenshot. empty secure and fail2ban

When i cat /var/log/fail2ban-20161211 it shows, but secure log was end up by 2016-12-08 enter image description here

Here is my config enter image description here

rsyslog is also running.

enter image description here


Solution

Finally, i solve it. Just add the code in config

/bin/kill -HUP `cat /var/run/rsyslogd.pid 2> /dev/null` || true

After i restart the server, it works.



Answered By - pytheworld