LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 02-21-2006, 10:07 AM   #1
sunman
Member
 
Registered: Jun 2005
Distribution: Slackware64 13.0 (multilib)
Posts: 67

Rep: Reputation: 15
logrotate question


I just installed clamav on my system here at home and have set up freshclam and verified that it works alright. I then added a tiny script in /etc/cron.daily to run it once a day quietly, but I figured it'd be nice to be able to see the log for it so I made one in /var/log and edited the configuration file so for freshclam so that it's written to when I run freshclam --quiet. Verified that the logging is working alright, so then I decided to try and make the logs so that they will rotate weekly and this is where I have a couple of questions.

First, I looked at the manpage for logrotate and it gives an example configuration file, with entries such as:
Code:
/var/log/messages {
    rotate 5
    weekly
    postrotate
                              /sbin/killall -HUP syslogd
    endscript
}
What exactly is the kill being used for and why?

I assumed that possibly it has something to do with the fact that the log file is in use by the daemon, but I have no idea really.

Next, I don't believe that for my entry in logrotate.conf that I'd need to kill anything as I've seen for other entries because I'm not running freshclam as a daemon, but as a daily cron job. But do I need to actually kill anything?

My entry after reading the man page for logrotate looks like this:
Code:
# Rotate the clamav update log
/var/log/freshclam.log {
    weekly
    create 0600 clamav clamav
    rotate 4
}
Will that work alright or am I missing anything?

Thanks a lot for any help, just want to make sure I'm doing this correctly.
 
Old 02-21-2006, 01:36 PM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
You are correct, the syslog daemon is being re-started because /var/log/messages was in use. You are also correct that since freshclam runs out of cron, opens and then closes a log file, that you won't need to kill freshclam.

Comparing your logrotate entry to the man page: You want to rotate the /var/log/freshclam.log weekly and have 4 archive copies with all of the files created with the permissions 0600, owned by clamav and in the clamav group. If that's what you want to do - then you're set...
 
Old 02-21-2006, 01:38 PM   #3
sunman
Member
 
Registered: Jun 2005
Distribution: Slackware64 13.0 (multilib)
Posts: 67

Original Poster
Rep: Reputation: 15
Thanks for replying, and yes that's what I was aiming for as far as backing up the logs. I did some more research and found that sending the HUP signals is usually to cause a program to reread it's configuration files, which I figured, for the programs that use it, is what causes the new log file to be generated.

Just wanting to make sure I understand things

Thanks again.
 
Old 02-21-2006, 01:40 PM   #4
cwwilson721
Senior Member
 
Registered: Dec 2004
Location: In my house.
Distribution: Ubuntu 10.10 64bit, Slackware 13.1 64-bit
Posts: 2,649
Blog Entries: 1

Rep: Reputation: 67
It has to kill the process to make sure that it won't get into something close to a brother/sister fight over the remote for the TV. If you unplug the TV, no fight over the remote....No process, no fight over the log.

I always compare computers/OS's to children.....I'm getting way too old. lol
 
  


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
Quick logrotate question Jukas Debian 0 11-10-2005 06:04 PM
a question about logrotate? hueofwind Linux - Newbie 3 11-08-2005 08:08 PM
logrotate dominant Linux - Newbie 1 02-13-2004 09:28 AM
logrotate question glock19 Linux - Networking 1 05-12-2003 09:08 PM
A question on logrotate marcoc Linux - Networking 2 02-21-2003 05:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 02:55 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
Open Source Consulting | Domain Registration