The officially official Devuan Forum!

You are not logged in.

#1 2024-10-02 16:43:30

Mike-thinky
Member
Registered: 2021-10-28
Posts: 74  

Daedalus 5.01 desktop, Runit version, logrotate error spotted

Hi, a recent install on a laptop I used the 5.01 Daedalus Am64, desktop iso.

I had a few niggles I had to track down and on the way I noticed some significant logrotate issues.

ls -la /var/log

total 16428
drwxr-xr-x 15 root        root        4096 Oct  1 10:19 .
drwxr-xr-x 13 root        root        4096 Sep 27 18:09 ..
drwxr-xr-x  2 root        root        4096 Oct  1 09:56 account
-rw-r--r--  1 root        root           0 Oct  1 10:19 alternatives.log	****
-rw-r--r--  1 root        root      132906 Sep 29 18:32 alternatives.log.1	****
drwxr-xr-x  2 root        root        4096 Feb 14  2023 apparmor
drwxr-xr-x  2 root        root        4096 Oct  1 10:19 apt
-rw-r-----  1 root        adm            0 Oct  1 10:19 auth.log		****
-rw-r-----  1 root        adm       167590 Oct  2 01:25 auth.log.1		****
-rw-r-----  1 root        adm       309762 Oct  1 09:49 auth.log.2.gz
-rw-r-----  1 root        adm         5497 Oct  1 09:50 boot
-rw-r-----  1 root        adm         5657 Sep 29 12:18 boot.0
-rw-r-----  1 root        adm         1221 Sep 27 19:35 boot.1.gz
-rw-r-----  1 root        adm         1121 Sep 27 13:30 boot.2.gz
-rw-r-----  1 root        adm          136 Sep 27 12:53 boot.3.gz
-rw-rw----  1 root        utmp           0 Oct  1 10:19 btmp
-rw-rw----  1 root        utmp           0 Sep 27 12:53 btmp.1
drwxr-xr-x  2 root        root        4096 Sep 29 12:28 chkrootkit
-rw-r-----  1 root        adm            0 Oct  1 10:19 cron.log		****
-rw-r-----  1 root        adm         7265 Oct  2 01:25 cron.log.1		****
-rw-r-----  1 root        adm         8976 Oct  1 09:45 cron.log.2.gz
drwxr-xr-x  2 root        root        4096 Oct  1 10:19 cups
-rw-r-----  1 root        adm        78491 Oct  1 09:50 dmesg
-rw-r-----  1 root        adm        77424 Sep 29 12:18 dmesg.0
-rw-r-----  1 root        adm        20165 Sep 27 19:35 dmesg.1.gz
-rw-r-----  1 root        adm        18823 Sep 27 13:30 dmesg.2.gz
-rw-r--r--  1 root        root           0 Oct  1 10:19 dpkg.log		****
-rw-r--r--  1 root        root     3188602 Oct  1 03:24 dpkg.log.1		****
drwxr-s---  2 Debian-exim adm         4096 Oct  1 10:19 exim4
-rw-r--r--  1 root        root           0 Sep 27 12:53 faillog
-rw-r--r--  1 root        root       13581 Sep 29 15:23 fontconfig.log
drwxr-xr-x  2 root        root        4096 Sep 27 12:53 fsck
drwxr-xr-x  3 root        root        4096 Sep 27 13:29 installer
-rw-r-----  1 root        adm            0 Oct  1 10:19 kern.log		****
-rw-r-----  1 root        adm       294704 Oct  2 01:18 kern.log.1		****
-rw-r-----  1 root        adm       200714 Oct  1 09:49 kern.log.2.gz
-rw-rw-r--  1 root        utmp      292292 Oct  1 09:51 lastlog
-rw-r--r--  1 root        root      108254 Sep 27 13:52 popularity-contest
-rw-r--r--  1 root        root           0 Sep 27 13:52 popularity-contest.0
-rw-r--r--  1 root        root       29035 Sep 27 13:52 popularity-contest.gpg
drwxrwxr-t  2 root        postgres    4096 Sep 28 22:47 postgresql
drwxr-x---  2 puppet      puppet      4096 Feb 10  2023 puppet
drwxr-x---  2 puppet      puppet      4096 May  7  2023 puppetserver
drwxr-xr-x  9 root        root        4096 Sep 28 14:49 runit
-rw-r--r--  1 root        root         123 Oct  1 09:51 slim.log
-rw-r--r--  1 root        root          75 Sep 29 12:31 slim.log.1
-rw-r-----  1 root        adm            0 Oct  1 10:19 syslog			****
-rw-r-----  1 root        adm      1931572 Oct  2 01:25 syslog.1		****
-rw-r-----  1 root        adm       186794 Oct  1 09:49 syslog.2.gz
drwxr-xr-x  2 root        root        4096 Dec  4  2022 sysstat
-rw-r-----  1 root        adm            0 Oct  1 10:19 user.log		****
-rw-r-----  1 root        adm         1178 Oct  2 00:56 user.log.1		****
-rw-r-----  1 root        adm          727 Oct  1 07:59 user.log.2.gz
-rw-rw-r--  1 root        utmp      635520 Oct  2 01:25 wtmp
-rw-rw-r--  1 root        utmp     9141120 Oct  1 10:19 wtmp.1
-rw-r--r--  1 root        root       43922 Oct  2 00:56 Xorg.0.log
-rw-r--r--  1 root        root       42509 Oct  1 09:49 Xorg.0.log.old

I have added some asterix to highlight that there were many pairs of logs where the log file proper stayed at zero, and the *.1 log is the one that keeps growing.

I used this next webpage to see what might be happening:
https://serverfault.com/questions/82372 … rrect-file

So then I tried to force an update
Usage: logrotate [-dfv?] [-d|--debug] [-f|--force] [-m|--mail=command] [-s|--state=statefile] [-v|--verbose] [-l|--log=logfile] [--version] [-?|--help] [--usage] [OPTION...] < configfile >

sudo logrotate -f /etc/logrotate.conf

This did not work because the proper file of each set was still blank...
This next page gave me some more to go on.

sudo logrotate --force -d /etc/logrotate.conf > ~/Documents/logrotateForce.txt
warning: logrotate in debug mode does nothing except printing debug messages!  Consider using verbose mode (-v) instead if this is not what you want.

reading config file /etc/logrotate.conf
including /etc/logrotate.d
reading config file alternatives
reading config file apt
reading config file aptitude
reading config file btmp
reading config file cups-daemon
reading config file dpkg
reading config file dracut-core
reading config file exim4-base
reading config file exim4-paniclog
reading config file postgresql-common
reading config file ppp
reading config file rkhunter
reading config file rsyslog
reading config file sane-utils
reading config file slim
reading config file wtmp
Reading state from file: /var/lib/logrotate/status
Allocating hash table for state file, size 64 entries
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state

Handling 17 logs

rotating pattern: /var/log/alternatives.log  forced from command line (12 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/alternatives.log
  Now: 2024-10-02 02:00
  Last rotated at 2024-10-01 10:19
  log does not need rotating (log is empty)

rotating pattern: /var/log/apt/term.log  forced from command line (12 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/apt/term.log
  Now: 2024-10-02 02:00
  Last rotated at 2024-10-01 10:19
  log does not need rotating (log is empty)

rotating pattern: /var/log/apt/history.log  forced from command line (12 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/apt/history.log
  Now: 2024-10-02 02:00
  Last rotated at 2024-10-01 10:19
  log does not need rotating (log is empty)

rotating pattern: /var/log/aptitude  forced from command line (6 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/aptitude
  log /var/log/aptitude does not exist -- skipping

rotating pattern: /var/log/btmp  forced from command line (1 rotations)
empty log files are rotated, old logs are removed
considering log /var/log/btmp
  Now: 2024-10-02 02:00
  Last rotated at 2024-10-02 01:46
  log needs rotating
rotating log /var/log/btmp, log->rotateCount is 1
dateext suffix '-20241002'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
renaming /var/log/btmp.1 to /var/log/btmp.2 (rotatecount 1, logstart 1, i 1), 
log /var/log/btmp.2 doesn't exist -- won't try to dispose of it
renaming /var/log/btmp to /var/log/btmp.1
creating new /var/log/btmp mode = 0660 uid = 0 gid = 43

rotating pattern: /var/log/cups/*log  forced from command line (7 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/cups/access_log
  Now: 2024-10-02 02:00
  Last rotated at 2024-10-01 10:19
  log does not need rotating (log is empty)
considering log /var/log/cups/error_log
  Now: 2024-10-02 02:00
  Last rotated at 2024-10-01 10:19
  log does not need rotating (log is empty)
not running postrotate script, since no logs were rotated

rotating pattern: /var/log/dpkg.log  forced from command line (12 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/dpkg.log
  Now: 2024-10-02 02:00
  Last rotated at 2024-10-01 10:19
  log does not need rotating (log is empty)

rotating pattern: /var/log/dracut.log  forced from command line (12 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/dracut.log
  log /var/log/dracut.log does not exist -- skipping

rotating pattern: /var/log/exim4/mainlog /var/log/exim4/rejectlog  forced from command line (10 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/exim4/mainlog
  log /var/log/exim4/mainlog does not exist -- skipping
considering log /var/log/exim4/rejectlog
  log /var/log/exim4/rejectlog does not exist -- skipping

rotating pattern: /var/log/exim4/paniclog  forced from command line (10 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/exim4/paniclog
  log /var/log/exim4/paniclog does not exist -- skipping

rotating pattern: /var/log/postgresql/*.log  forced from command line (10 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/postgresql/postgresql-15-main.log
  Now: 2024-10-02 02:00
  Last rotated at 2024-10-02 01:46
  log does not need rotating (log is empty)

rotating pattern: /var/log/ppp-connect-errors  forced from command line (4 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/ppp-connect-errors
  log /var/log/ppp-connect-errors does not exist -- skipping

rotating pattern: /var/log/rkhunter.log  forced from command line (4 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/rkhunter.log
  log /var/log/rkhunter.log does not exist -- skipping

rotating pattern: /var/log/syslog
/var/log/mail.log
/var/log/kern.log
/var/log/auth.log
/var/log/user.log
/var/log/cron.log
 forced from command line (60 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/syslog
  Now: 2024-10-02 02:00
  Last rotated at 2024-10-01 10:19
  log does not need rotating (log is empty)
considering log /var/log/mail.log
  log /var/log/mail.log does not exist -- skipping
considering log /var/log/kern.log
  Now: 2024-10-02 02:00
  Last rotated at 2024-10-01 10:19
  log does not need rotating (log is empty)
considering log /var/log/auth.log
  Now: 2024-10-02 02:00
  Last rotated at 2024-10-01 10:19
  log does not need rotating (log is empty)
considering log /var/log/user.log
  Now: 2024-10-02 02:00
  Last rotated at 2024-10-01 10:19
  log does not need rotating (log is empty)
considering log /var/log/cron.log
  Now: 2024-10-02 02:00
  Last rotated at 2024-10-01 10:19
  log does not need rotating (log is empty)
not running postrotate script, since no logs were rotated

rotating pattern: /var/log/saned.log  forced from command line (7 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/saned.log
  log /var/log/saned.log does not exist -- skipping

rotating pattern: /var/log/slim.log  forced from command line (4 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/slim.log
  Now: 2024-10-02 02:00
  Last rotated at 2024-10-02 01:46
  log does not need rotating (log is empty)

rotating pattern: /var/log/wtmp  forced from command line (1 rotations)
empty log files are rotated, only log files >= 1048576 bytes are rotated, old logs are removed
considering log /var/log/wtmp
  Now: 2024-10-02 02:00
  Last rotated at 2024-10-02 01:46
  log needs rotating
rotating log /var/log/wtmp, log->rotateCount is 1
dateext suffix '-20241002'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
renaming /var/log/wtmp.1 to /var/log/wtmp.2 (rotatecount 1, logstart 1, i 1), 
log /var/log/wtmp.2 doesn't exist -- won't try to dispose of it
renaming /var/log/wtmp to /var/log/wtmp.1
creating new /var/log/wtmp mode = 0664 uid = 0 gid = 43

So now I had to add a postcondition halt and restart of syslog into the config files, on a temporary basis I stopped the option to do nothing if the log was empty. I think that last bit is only needed on a temporary basis until the postcondition operation is added.
Once I had done that the log files started behaving correctly

Offline

#2 2024-10-06 17:54:25

Lorenzo
Member
Registered: 2020-03-03
Posts: 46  

Re: Daedalus 5.01 desktop, Runit version, logrotate error spotted

Hi!

do you have rsyslog and anacron or cron installed in your runit system?

I believe this is the result of
(some cronjobs are skipped due to invoke-rc.d actions not effective on some runscripts)
https://bugs.debian.org/cgi-bin/bugrepo … ug=1071395
and
(rsyslogd maintainer sabotaging alternative inits, affecting runit-services)
https://bugs.debian.org/cgi-bin/bugrepo … ug=1079268

fix will be available in next stable release (already have commits in git, still need to do some testing though)
Apologies for the inconvenient, I didn't catch this before current stable was released hmm

Lorenzo

Offline

#3 2024-10-07 08:31:01

Mike-thinky
Member
Registered: 2021-10-28
Posts: 74  

Re: Daedalus 5.01 desktop, Runit version, logrotate error spotted

Hi Lorenzo,

I have rsyslog and cron definitely installed on that laptop.

good to know the fix is on its way, I am not sure if the postcondition I used is correct or in the correct file(s).

Mike

Offline

Board footer