[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Error with logrotate.



On Tuesday 13 August 2019 05:41:52 Dan Purgert wrote:

> Gene Heskett wrote:
> > On Tuesday 13 August 2019 02:24:34 deloptes wrote:
> > [...]
> >
> >> I am not aware of any program I've been using
> >> for the past 15y that would have a problem writing in /var/log
> >
> > Then tell me how fetchmail, procmail, clamav or spamd running as me,
> > can keep their logs in /var/log, the permissions just aren't there
> > after a reboot.
>
> Aren't all four of those system services; with their own system users,
> with their own directories in /var/log (or well, at least by default)?
>
No, while they may be callable by anyone, they all become the user 
calling them.

> >> [...]
> >> Logrotate also does not need to be modified - only for your custom
> >> stuff, so it is expected and desired and it is easy to adjust.
> >
> > Maybe for someone intimately fam with how it works, not so easy on a
> > onetime basis after an install. One doesn't get familiar enough, nor
> > manage to commit it to short term memory.
>
> Assuming a Debian-standard /etc/logrotate.conf; it should give one the
> necessary examples to set up a functioning schedule for things in
> their $HOME (or other places).

O0kkaayy, splain this:
my entry for these logs in /etc/logrotate.d:

/home/gene/log/fetchmail.log
/home/gene/log/procmail.log
/home/gene/log/mail.log
{
        su gene mail
        rotate 4
        maxsize 5000000
        weekly
        missingok
        notifempty
        copytruncate
        compress
        delaycompress
        postrotate
                kill -HUP fetchmail
                kill -HUP procmail
                kill -HUP spamd
        endscript
}

and an ls -l of ~/log

gene@coyote:/etc/logrotate.d$ ls -l  ~/log
total 68804
-rw-r--r-- 1 gene gene  5413354 Aug 13 09:36 fetchmail.log
-rw------- 1 gene mail        0 Aug 12 00:08 fetchmail.log.1
-rw------- 1 gene mail       20 Aug  4 00:10 fetchmail.log.2.gz
-rw------- 1 gene mail       20 Jul 28 00:09 fetchmail.log.3.gz
-rw-r--r-- 1 gene gene   636567 Aug 13 09:36 mail.log
-rw------- 1 gene mail        0 Aug 12 00:08 mail.log.1
-rw------- 1 gene mail       20 Aug  4 00:10 mail.log.2.gz
-rw------- 1 gene mail       20 Jul 28 00:09 mail.log.3.gz
-rw-r--r-- 1 gene gene 64361979 Aug 13 09:36 procmail.log
-rw------- 1 gene mail        0 Aug 12 00:08 procmail.log.1
-rw------- 1 gene mail       20 Aug  4 00:10 procmail.log.2.gz
-rw------- 1 gene mail       20 Jul 28 00:09 procmail.log.3.g

Which does not look like its being properly rotated to me.
Yet this worked (without the maxsize option I just now added) for all the 
years on wheezy.  And yes, I am a member of group mail

Thanks.

Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis
Genes Web page <http://geneslinuxbox.net:6309/gene>


Reply to: