LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   logrotate not create empty file (https://www.linuxquestions.org/questions/linux-server-73/logrotate-not-create-empty-file-797482/)

malikperera 03-24-2010 02:52 AM

logrotate not create empty file
 
Recently I installed new server and having some issues with logrotate
When the logrotate start it will rotate the log files as it should be but never recreate the original file. Further investigation shows issue is due to command after logrotate, whis is “reload rsyslog >/dev/null 2>&1 || true”


So far logrotate worked fine for any log file as long as you don't have to issue above reload command.
Only way I could restart the rsyslog using service rsyslog restart


All the missing log files recreate as soon as rsyslog restarted.
I'm using Ubuntu 9.10 with follwing kernel and software vertions
2.6.31-20-generic-pae #58-Ubuntu SMP Fri Mar 12 06:25:51 UTC 2010 i686 GNU/Linux
logrotate 3.7.8-4ubuntu1
rsyslog 4.2.0-2ubuntu5.1


I can confirm file recreation configured. I have another two servers with same software versions and I could not see this issue. Differences are the server with this issue have virtualbox installed and few guests are running (I do not this this is an issue).
Other diffrence is is var mounted using following options rw,noatime,data=writeback,errors=remount-ro
File system is ext4
I do not know they make any diffrence.

Following I done to failed to resolve the issue
reinstall rsyslog and logrotate

Reboot the server. All the missing logfiles recreated (because rsyslog restsred).

malikperera 03-24-2010 06:30 PM

I think found the issue. Missing create in the below create new logfiles. So far working. i have to keep eye on for few days.

# create new (empty) log files after rotating old ones

# uncomment this if you want your log files compressed

Now it look like this
# create new (empty) log files after rotating old ones
create
# uncomment this if you want your log files compressed


All times are GMT -5. The time now is 09:25 PM.