The officially official Devuan Forum!

You are not logged in.

#1 2021-04-01 15:43:43

Altoid
Member
Registered: 2017-05-07
Posts: 1,415  

[SOLVED] Duplicate log entry for /var/log/wtm - logrotate.conf error

Hello:

There is a bug in the logrotate.conf configuration.
See here: https://bugs.launchpad.net/ubuntu/+sour … ug/1915759

ralph.ronnquist pointed it out to me here: https://dev1galaxy.org/viewtopic.php?pid=28663#p28663 while helping me with an anacron problem caused (probably) live-config.
The error shows up when logrotate is run in /etc/cron.whatever and then you get notifocaton from the system:

From root@devuan Thu Apr 01 11:31:07 2021
Envelope-to: root@devuan
Delivery-date: Thu, 01 Apr 2021 11:31:07 -0300
From: Anacron <root@devuan>
To: root@devuan
Subject: Anacron job 'cron.daily' on devuan
Content-Type: text/plain; charset=US-ASCII
Date: Thu, 01 Apr 2021 11:31:07 -0300

/etc/cron.daily/logrotate:
error: /etc/logrotate.conf:18 duplicate log entry for /var/log/wtmp
error: /etc/logrotate.conf:25 duplicate log entry for /var/log/btmp
run-parts: /etc/cron.daily/logrotate exited with return code 1

The problem is that the fix posted is an Ubuntu fix.
ie: probably will not run properly in Devuan without adjusting it

Anyone know how to edit it so it will run?

Thanks in advance.

Cheers,

A.

Offline

#2 2021-04-01 16:16:01

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 3,125  
Website

Re: [SOLVED] Duplicate log entry for /var/log/wtm - logrotate.conf error

Altoid wrote:

The problem is that the fix posted is an Ubuntu fix.
ie: probably will not run properly in Devuan without adjusting it

Have you actually tried applying the fix? It looks fairly generic.

(FWIW I don't have any wtmp lines in /etc/logrotate.conf in my bullseye system.)


Brianna Ghey — Rest In Power

Offline

#3 2021-04-01 16:54:49

Altoid
Member
Registered: 2017-05-07
Posts: 1,415  

Re: [SOLVED] Duplicate log entry for /var/log/wtm - logrotate.conf error

Hello:

Head_on_a_Stick wrote:

Have you actually tried ...

Yes.
At least in my system it is not a drop-in replacement.

There is at least one thing I noticed.
And the fixed logrotate.conf has this:

# use the syslog group by default, since this is the owning group
# of /var/log/syslog.
su root syslog

In Devuan Beowulf there is not syslog group (at least I can't find it).

groucho@devuan:~$ grep syslog /etc/group
groucho@devuan:~$ 

Also, syslog is owned by root but belongs to the adm group:

groucho@devuan:~$ ls -l /var/log/syslog
-rw-r----- 1 root adm 4816 Apr  1 13:30 /var/log/syslog
groucho@devuan:~$ 

That's why I think someone esle with proper skills has to have a look.

Head_on_a_Stick wrote:

... don't have any wtmp lines in /etc/logrotate.conf in my bullseye ...

My Devuan Beowulf has it:

roucho@devuan:~$ cat /etc/logrotate.conf
# see "man logrotate" for details
# rotate log files weekly
weekly

# keep 4 weeks worth of backlogs
rotate 4

# create new (empty) log files after rotating old ones
create

# uncomment this if you want your log files compressed
compress

# packages drop log rotation information into this directory
include /etc/logrotate.d

# no packages own wtmp, or btmp -- we'll rotate them here
/var/log/wtmp {   <----- | x |
    missingok
    monthly
    create 0664 root utmp
    rotate 1
}

/var/log/btmp {   <----- | x |
    missingok
    monthly
    create 0660 root utmp
    rotate 1
}

# system-specific logs may be configured here
groucho@devuan:~$ 

So apparently that is why we get the mail I posted.

What does your logrotate.conf look like?

Thanks for your input.

Best,

A.

Offline

#4 2021-04-01 17:11:12

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 3,125  
Website

Re: [SOLVED] Duplicate log entry for /var/log/wtm - logrotate.conf error

Altoid wrote:

At least in my system it is not a drop-in replacement.

Why not? What happens when you comment-out the wtmp & btmp stanzas?

Altoid wrote:

What does your logrotate.conf look like?

https://salsa.debian.org/debian/logrota … otate.conf


Brianna Ghey — Rest In Power

Offline

#5 2021-04-01 19:06:29

Altoid
Member
Registered: 2017-05-07
Posts: 1,415  

Re: [SOLVED] Duplicate log entry for /var/log/wtm - logrotate.conf error

Hello:

Head_on_a_Stick wrote:

Why not?
What happens when you comment-out the wtmp & btmp stanzas?

Don't know.
I did not edit anything, I just renamed the original as logrotate.old and copied the new one in.

Head_on_a_Stick wrote:
Altoid wrote:

What does your logrotate.conf look like?

https://salsa.debian.org/debian/logrota … otate.conf

My Devuan Beowulf has logrotate 3.14.0:

groucho@devuan:~$ sudo logrotate --version
logrotate 3.14.0

    Default mail command:       /usr/bin/mail
    Default compress command:   /bin/gzip
    Default uncompress command: /bin/gunzip
    Default compress extension: .gz
    Default state file path:    /var/lib/logrotate/status
    ACL support:                yes
    SELinux support:            yes
groucho@devuan:~$ 

But for some strange reason, the logrotate.conf file I have is the logrotate.conf file packaged with logrotate 3.13.0, without this line:

--- snip ---
# use date as a suffix of the rotated file    <---- | x |
dateext
--- snip ---

The rest is the same.

See: https://github.com/logrotate/logrotate/ … 3.0.tar.gz

I'll get the .*conf file from logrotate 3.14.0 and use that.
Will report back once done.

Edit:
Works, no errors.
But my logrotate.conf file was the wrong version.

Thanks for your input.
 
Best,

A.

Last edited by Altoid (2021-04-01 19:15:28)

Offline

Board footer