LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-18-2013, 01:58 PM   #1
linuxr00lz2013
LQ Newbie
 
Registered: Sep 2013
Posts: 20

Rep: Reputation: Disabled
Logrotate causes rsyslogd to stop working after log rotation. Please help!


hello all

I noticed that each time logrotate runs on my RHEL 5.9 Linux server, it causes rsyslogd to stop working and I have to manually restart it. I am trying to configure logrotate that it restarts rsyslog after its completed rotating the logs. I placed the following in my logrotate.conf for one of the logs for testing purposes. Please let me know if this looks correct:

Code:
/var/logs/example/example.log {
    daily
    rotate 365
    create 0644 root root
    postrotate
        reload rsyslog >/dev/null 2>&1 || true
    endscript
}
Does this look good and how should I go about testing if this is working?


Thanks for all of your help!!

Last edited by linuxr00lz2013; 09-18-2013 at 02:00 PM.
 
Old 09-19-2013, 06:56 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390
Not sure if reload rsyslog >/dev/null 2>&1 || true is the correct entry, try the following:
Code:
/var/log/firewall {
    daily
    compress
    rotate 365
    create 0644 root root
    postrotate
        /etc/init.d/rsyslog reload
    endscript
}
I also added an extra option (green one), which might be handy (compressing the rotated files).

Testing can be done as follows:

- logrotate -d /etc/logrotate.conf to check (no changes are made, just for debugging),
- logrotate -fv /etc/logrotate.conf force logrotate to do its job,
- Have a look at the log file: /var/lib/logrotate/status (location might be different).

Also have a look here: Manage Linux log files with Logrotate

Last edited by druuna; 09-19-2013 at 06:57 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
logrotate and syslog rotation issues rhel6 gr0undzer0 Linux - Software 5 05-28-2016 02:29 AM
Question about logrotate and weekly rotation circus78 Linux - Server 2 07-04-2012 11:17 AM
apache request_log rotation - logrotate noir911 Linux - Server 2 09-10-2008 11:29 PM
Log Rotation for snort log does not seem to be working CentOS4.5 JasonKretzer Linux - Security 3 06-25-2007 01:25 PM
Log Rotation using Logrotate keysorsoze Linux - General 4 04-13-2007 03:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:23 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration