LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-24-2010, 02:52 AM   #1
malikperera
LQ Newbie
 
Registered: Aug 2004
Location: Australia
Distribution: Kubuntu
Posts: 10

Rep: Reputation: 0
Unhappy 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).
 
Old 03-24-2010, 06:30 PM   #2
malikperera
LQ Newbie
 
Registered: Aug 2004
Location: Australia
Distribution: Kubuntu
Posts: 10

Original Poster
Rep: Reputation: 0
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
create empty file in script roadrash Linux - General 2 10-26-2009 07:33 PM
how do i create an empty bash(.sh) file in command line? bbmak Linux - Newbie 1 10-26-2007 02:39 AM
How to create cron job to empty mbox folder/file sjmo2 Linux - General 4 03-23-2006 02:39 PM
Can I create a empty /etc/ld.so.preload ? michael_util Linux - Software 1 01-20-2005 06:10 PM
Can you create an empty file and specify the byte length? harryo Linux - General 3 02-25-2004 10:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration