Rsyslog doesn't write logs to file after logrotate

General discussions here

Moderator: rgerhards

Google Ads


Rsyslog doesn't write logs to file after logrotate

Postby pippo » Tue Jun 27, 2017 11:18 am

Hi,

I'm facing a strange issue with rsyslog.

I configured logrotation for my logfile, this is running fine.

But when the logs are rotated, rsyslog keeps writing to the same file (that is normal, because I didn't reloaded rsyslog for the moment).

I tried to :

Code: Select all
systemctl restart rsyslog


AND

Code: Select all
kill -HUP $(cat /var/run/rsyslogd.pid)
kill $(cat /var/run/rsyslog.pid)
systemctl start rsyslog


AND Changing the logfile in rsyslog.conf then switching back to the good one.

When I look which file is used by rsyslog, it shows no file :
Code: Select all
[root@elk-31-t ~]# ps -aux |grep rsyslog
root      6810  0.0  0.0 403112  4056 ?        Ssl  11:57   0:00 /sbin/rsyslogd -n
root      6877  0.0  0.0 112668   964 pts/0    S+   12:04   0:00 grep --color=auto rsyslog
[root@elk-31-t ~]# ls -l /proc/6810/fd
total 0
lr-x------ 1 root root 64 27 juin  11:57 0 -> /dev/null
l-wx------ 1 root root 64 27 juin  11:57 1 -> /dev/null
lrwx------ 1 root root 64 27 juin  11:57 10 -> anon_inode:[eventpoll]
l-wx------ 1 root root 64 27 juin  11:57 2 -> /dev/null
lrwx------ 1 root root 64 27 juin  11:57 3 -> socket:[29329608]
lrwx------ 1 root root 64 27 juin  11:57 4 -> socket:[29329613]
lrwx------ 1 root root 64 27 juin  11:57 5 -> socket:[29329614]
lrwx------ 1 root root 64 27 juin  11:57 6 -> socket:[29329617]
lrwx------ 1 root root 64 27 juin  11:57 7 -> socket:[29329618]
lrwx------ 1 root root 64 27 juin  11:57 8 -> socket:[29329623]
lrwx------ 1 root root 64 27 juin  11:57 9 -> anon_inode:[eventpoll]


Here is my logrotate config (for the syslog) :

/var/log/cron
/var/log/maillog
/var/log/rsyslog-log
/var/log/secure
/var/log/spooler
{
daily
rotate 2
dateext
notifempty
create
sharedscripts
postrotate
kill -HUP $(cat /var/run/rsyslogd.pid)
endscript

}


How to restart rsyslog properly and avoid this issue?

Thanks
pippo
New
 
Posts: 6
Joined: Fri Jun 16, 2017 11:05 am

Urgent Question?

  • Pulling out your Hair?
  • Wasting Time and Money?
  • Deadline Approaching?

Re: Rsyslog doesn't write logs to file after logrotate

Postby pippo » Tue Jun 27, 2017 12:27 pm

I just realised that I opened this thread twice.

This one can be closed.

Sorry
pippo
New
 
Posts: 6
Joined: Fri Jun 16, 2017 11:05 am

Google Ads



Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron