On Wednesday, August 04, 2010 12:39:53 pm Stephen Gallagher did opine: > On 08/04/2010 11:35 AM, Gene Heskett wrote: > > Greetings list; > > > > 2 redhat employees are list as the authors of logrotate in the > > manpage, so I just sent them a question because it isn't working as > > expected. > > Obvious question: are you sure that the issue is logrotate and not the > application whose logs you are trying to rotate? > > For most daemons, logrotate works by doing the following: > > 1) Move the logfile to a new name (e.g. daemon.log.1). This maintains > the current file descriptors, so the daemon continues to log to the file > at its new name. Is this not what the copytruncate directive does? > 2) Send a signal (SIGHUP) to the daemon. The daemon needs to be > configured to properly receive this signal. Yes, it can be, but for these tests, fetchmail had been killed, as well as the tail -f on the file, so the file s/b be free of any impediments. I can add those niceties once this is working, because if I add them and they don't work, I at least know it _was_ working. > The responsibility of the > daemon is to close its current file descriptors for the log and open new > ones at the original location (creating a new file) and then start > logging to that one. Since /var/log seems to be root only territory, I create the original file and chown it to me since fetchmail, running as me, cannot create a new file there. This is why the copytruncate is used, I found it to be much more dependable than the "create 0600 gene:gene" directive, which seems to be rejected because it tries to do that as the user gene who doesn't have perms to create a file in /var/log. FWIW, copytruncate has worked well for exactly this function for several years now. > 3) Optionally compress the old log file and/or remove any log file > backups older than a configured number of revisions. > > > So my question to you is: are you sure that step 2 isn't where it's > failing? Because in general, logrotate is pretty simple code and there > aren't a lot of opportunities for it to misbehave. That is why I'm asking for help, it seems to be misbehaving. ;-) -- Cheers, Gene "There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order." -Ed Howdershelt (Author) Women in love consist of a little sighing, a little crying, a little dying -- and a good deal of lying. -- Ansey -- users mailing list users@xxxxxxxxxxxxxxxxxxxxxxx To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines