On Ubuntu 22.04 logrotate does not rotate syslog

Bug #1959439 reported by corrado venturini
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
logrotate (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

On my Ubuntu 22.04 Jammy installed 2022-01-03 /var/log/syslog is very big and was never rotated.

corrado@corrado-n3-jj-0103:~$ stat /var/log/syslog
  File: /var/log/syslog
  Size: 77434065 Blocks: 151248 IO Block: 4096 regular file
Device: 10303h/66307d Inode: 264672 Links: 1
Access: (0640/-rw-r-----) Uid: ( 104/ syslog) Gid: ( 4/ adm)
Access: 2022-01-28 16:35:50.408728666 +0100
Modify: 2022-01-28 16:35:47.705029318 +0100
Change: 2022-01-28 16:35:47.705029318 +0100
 Birth: 2022-01-03 14:31:29.195999321 +0100
corrado@corrado-n3-jj-0103:~$

looking to journalctl i see logrotate has been started on January 25 but log file was not cut

corrado@corrado-n3-jj-0103:~$ journalctl -b-18 | grep logrotate
gen 25 07:58:01 corrado-n3-jj-0103 systemd[1]: logrotate.service: Deactivated successfully.
gen 25 09:35:09 corrado-n3-jj-0103 systemd[1]: logrotate.timer: Deactivated successfully.
corrado@corrado-n3-jj-0103:~$

corrado@corrado-n3-jj-0103:~$ systemctl status logrotate.service
○ logrotate.service - Rotate log files
     Loaded: loaded (/lib/systemd/system/logrotate.service; static)
     Active: inactive (dead)
TriggeredBy: ● logrotate.timer
       Docs: man:logrotate(8)
             man:logrotate.conf(5)
corrado@corrado-n3-jj-0103:~$

corrado@corrado-n3-jj-0103:~$ cat /etc/logrotate.conf
# see "man logrotate" for details

# global options do not affect preceding include directives

# rotate log files weekly
weekly

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

# keep 4 weeks worth of backlogs
rotate 4

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

# use date as a suffix of the rotated file
#dateext

# uncomment this if you want your log files compressed
#compress

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

# system-specific logs may also be configured here.
corrado@corrado-n3-jj-0103:~$

corrado@corrado-n3-jj-0103:~$ ls /var/log -lh
total 108M
-rw-r--r-- 1 root root 42K gen 27 21:20 alternatives.log
-rw-r----- 1 root adm 5,5K gen 28 17:32 apport.log
drwxr-xr-x 2 root root 4,0K gen 28 17:52 apt
-rw-r----- 1 syslog adm 762K gen 28 19:08 auth.log
-rw------- 1 root root 1019K gen 28 17:54 boot.log
-rw-r--r-- 1 root root 105K gen 3 08:43 bootstrap.log
-rw-rw---- 1 root utmp 0 gen 3 08:42 btmp
drwxr-xr-x 2 root root 4,0K gen 3 14:31 cups
drwxr-xr-x 2 root root 4,0K ott 29 18:59 dist-upgrade
-rw-r----- 1 root adm 81K gen 28 17:55 dmesg
-rw-r----- 1 root adm 80K gen 28 17:22 dmesg.0
-rw-r----- 1 root adm 22K gen 28 17:02 dmesg.1.gz
-rw-r----- 1 root adm 22K gen 28 16:01 dmesg.2.gz
-rw-r----- 1 root adm 22K gen 28 10:29 dmesg.3.gz
-rw-r----- 1 root adm 22K gen 28 08:54 dmesg.4.gz
-rw-r--r-- 1 root root 1,4M gen 28 17:52 dpkg.log
-rw-r--r-- 1 root root 32K gen 6 09:44 faillog
-rw-r--r-- 1 root root 12K gen 28 15:32 fontconfig.log
drwx--x--x 2 root gdm 4,0K gen 3 14:31 gdm3
-rw-r--r-- 1 root root 1,5K gen 28 17:54 gpu-manager.log
drwxr-xr-x 3 root root 4,0K gen 3 08:44 hp
drwxr-xr-x 2 root root 4,0K gen 3 13:59 installer
-rw-r--r-- 1 root root 544K gen 11 08:33 installer.zip
-rw-r--r-- 1 root root 544K gen 3 21:25 inst.zip
drwxr-sr-x+ 3 root systemd-journal 4,0K gen 3 14:31 journal
-rw-r----- 1 syslog adm 27M gen 28 19:09 kern.log
-rw-rw-r-- 1 root utmp 286K gen 6 09:44 lastlog
drwxr-xr-x 2 root root 4,0K nov 18 15:05 openvpn
drwx------ 2 root root 4,0K gen 3 08:42 private
drwx------ 2 speech-dispatcher root 4,0K dic 11 23:07 speech-dispatcher
-rw-r----- 1 syslog adm 76M gen 28 19:10 syslog
-rw------- 1 root root 90K gen 27 18:40 ubuntu-advantage.log
-rw------- 1 root root 6,1K gen 28 18:30 ubuntu-advantage-timer.log
drwxr-x--- 2 root adm 4,0K gen 6 10:28 unattended-upgrades
-rw-r--r-- 1 root root 392K gen 28 17:54 uvcdynctrl-udev.log
-rw-rw-r-- 1 root utmp 179K gen 28 17:56 wtmp
corrado@corrado-n3-jj-0103:~

corrado@corrado-n3-jj-0103:~$ cat /etc/logrotate.d/rsyslog
/var/log/syslog
/var/log/mail.info
/var/log/mail.warn
/var/log/mail.err
/var/log/mail.log
/var/log/daemon.log
/var/log/kern.log
/var/log/auth.log
/var/log/user.log
/var/log/lpr.log
/var/log/cron.log
/var/log/debug
/var/log/messages
{
 rotate 4
 weekly
 missingok
 notifempty
 compress
 delaycompress
 sharedscripts
 postrotate
  /usr/lib/rsyslog/rsyslog-rotate
 endscript
}
corrado@corrado-n3-jj-0103:~$

ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: logrotate 3.19.0-1ubuntu1
ProcVersionSignature: Ubuntu 5.15.0-18.18-generic 5.15.12
Uname: Linux 5.15.0-18-generic x86_64
ApportVersion: 2.20.11-0ubuntu76
Architecture: amd64
CasperMD5CheckResult: pass
CurrentDesktop: ubuntu:GNOME
Date: Fri Jan 28 19:08:37 2022
InstallationDate: Installed on 2022-01-03 (25 days ago)
InstallationMedia: Ubuntu 22.04 LTS "Jammy Jellyfish" - Alpha amd64 (20220103)
SourcePackage: logrotate
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
corrado venturini (corradoventu) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in logrotate (Ubuntu):
status: New → Confirmed
Revision history for this message
Nigel Winterbottom (8-nigel) wrote :

root@nigel-Latitude-E6420:~# logrotate /etc/logrotate.d/rsyslog --debug
WARNING: logrotate in debug mode does nothing except ...
...
considering log /var/log/syslog
error: skipping "/var/log/syslog" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.

Revision history for this message
Nigel Winterbottom (8-nigel) wrote :

root@nigel-Latitude-E6420:~# ls -l /var | fgrep log
drwxrwxr-x 14 root syslog 4096 Dec 2 16:46 log

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.