logrotate stopped working last July

General support questions
Post Reply
lightman47
Posts: 1522
Joined: 2014/05/21 20:16:00
Location: Central New York, USA

logrotate stopped working last July

Post by lightman47 » 2018/02/02 17:46:21

Up to date CentOs 7 (updates weekly)

I have a HUGE messages file and investigated - all the latest rotated files are July 17. Apparently something happened on that day (update maybe?)

Any way, I just yum reinstalled logrotate in case it got corrupted, and rebooted. I then tried to "log rotate -f" as root and apparently I am doing that wrong.

What do I need to check to find out WHY it stopped rotating files?

current .conf file:

Code: Select all

# 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

# use date as a suffix of the rotated file
dateext

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

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

# no packages own wtmp and btmp -- we'll rotate them here
/var/log/wtmp {
    monthly
    create 0664 root utmp
	minsize 1M
    rotate 1
}

/var/log/btmp {
    missingok
    monthly
    create 0600 root utmp
    rotate 1
}

# system-specific logs may be also be configured here.
Do you need more info?
Thank you.

-EDIT -

After googling, I tried logrotate -d /etc/logrotate.conf. I got output that LOOKed like it worked, but ls -la /var/log/ says differently.

output:

Code: Select all

$ sudo logrotate -d /etc/logrotate.conf
reading config file /etc/logrotate.conf
including /etc/logrotate.d
reading config file boinc-client
reading config file bootlog
reading config file chrony
reading config file clamav-update
reading config file cups
reading config file denyhosts
reading config file fail2ban
reading config file glusterfs
reading config file httpd
reading config file iscsiuiolog
reading config file libvirtd
reading config file libvirtd.qemu
reading config file numad
reading config file ppp
reading config file psacct
reading config file rkhunter
reading config file samba
olddir is now /var/log/samba/old
reading config file shorewall
reading config file sssd
reading config file syslog
reading config file wpa_supplicant
reading config file yum
Allocating hash table for state file, size 15360 B

Handling 26 logs

rotating pattern: /var/log/boinc.log /var/log/boincerr.log
 weekly (4 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/boinc.log
  log does not need rotating (log is empty)considering log /var/log/boincerr.log
  log does not need rotating (log is empty)not running prerotate script, since no logs will be rotated
not running postrotate script, since no logs were rotated

rotating pattern: /var/log/boot.log
 after 1 days (7 rotations)
empty log files are rotated, old logs are removed
considering log /var/log/boot.log
  log does not need rotating (log has been already rotated)
rotating pattern: /var/log/chrony/*.log  weekly (4 rotations)
empty log files are rotated, old logs are removed
considering log /var/log/chrony/*.log
  log /var/log/chrony/*.log does not exist -- skipping
not running postrotate script, since no logs were rotated

rotating pattern: /var/log/freshclam.log  monthly (4 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/freshclam.log
  log does not need rotating (log is empty)
rotating pattern: /var/log/cups/*_log  weekly (4 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/cups/access_log
  log needs rotating
considering log /var/log/cups/error_log
  log needs rotating
considering log /var/log/cups/page_log
  log needs rotating
rotating log /var/log/cups/access_log, log->rotateCount is 4
dateext suffix '-20180202'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
rotating log /var/log/cups/error_log, log->rotateCount is 4
dateext suffix '-20180202'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
rotating log /var/log/cups/page_log, log->rotateCount is 4
dateext suffix '-20180202'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
fscreate context set to system_u:object_r:cupsd_log_t:s0
renaming /var/log/cups/access_log to /var/log/cups/access_log-20180202
creating new /var/log/cups/access_log mode = 0600 uid = 0 gid = 7
fscreate context set to system_u:object_r:cupsd_log_t:s0
renaming /var/log/cups/error_log to /var/log/cups/error_log-20180202
creating new /var/log/cups/error_log mode = 0600 uid = 0 gid = 7
fscreate context set to system_u:object_r:cupsd_log_t:s0
renaming /var/log/cups/page_log to /var/log/cups/page_log-20180202
creating new /var/log/cups/page_log mode = 0600 uid = 0 gid = 7
removing old log /var/log/cups/access_log-20170702
removing old log /var/log/cups/error_log-20170514

rotating pattern: /var/log/denyhosts  102400 bytes (4 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/denyhosts
  log needs rotating
rotating log /var/log/denyhosts, log->rotateCount is 4
dateext suffix '-20180202'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
fscreate context set to system_u:object_r:denyhosts_var_log_t:s0
renaming /var/log/denyhosts to /var/log/denyhosts-20180202
creating new /var/log/denyhosts mode = 0644 uid = 0 gid = 0
running postrotate script
running script with arg /var/log/denyhosts: "
        /usr/bin/systemctl try-restart denyhosts > /dev/null 2>&1 || :
"
removing old log /var/log/denyhosts-20170629

rotating pattern: /var/log/fail2ban.log  weekly (4 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/fail2ban.log
  log needs rotating
rotating log /var/log/fail2ban.log, log->rotateCount is 4
dateext suffix '-20180202'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
fscreate context set to system_u:object_r:fail2ban_log_t:s0
renaming /var/log/fail2ban.log to /var/log/fail2ban.log-20180202
creating new /var/log/fail2ban.log mode = 0600 uid = 0 gid = 0
running postrotate script
running script with arg /var/log/fail2ban.log: "
      /usr/bin/fail2ban-client flushlogs >/dev/null || true
"
removing old log /var/log/fail2ban.log-20170702

rotating pattern: /var/log/glusterfs/*.log  weekly (52 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/glusterfs/*.log
  log /var/log/glusterfs/*.log does not exist -- skipping
not running postrotate script, since no logs were rotated

rotating pattern: /var/log/glusterfs/bricks/*.log  weekly (52 rotations)
empty log files are not rotated, old logs are removed
No logs found. Rotation not needed.

rotating pattern: /var/log/glusterfs/samples/*.samp  after 1 days (3 rotations)
empty log files are rotated, old logs are removed
No logs found. Rotation not needed.

rotating pattern: /var/log/httpd/*log  weekly (4 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/httpd/access_log
  log needs rotating
considering log /var/log/httpd/error_log
  log needs rotating
rotating log /var/log/httpd/access_log, log->rotateCount is 4
dateext suffix '-20180202'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
rotating log /var/log/httpd/error_log, log->rotateCount is 4
dateext suffix '-20180202'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
fscreate context set to system_u:object_r:httpd_log_t:s0
renaming /var/log/httpd/access_log to /var/log/httpd/access_log-20180202
creating new /var/log/httpd/access_log mode = 0644 uid = 0 gid = 0
fscreate context set to system_u:object_r:httpd_log_t:s0
renaming /var/log/httpd/error_log to /var/log/httpd/error_log-20180202
creating new /var/log/httpd/error_log mode = 0644 uid = 0 gid = 0
running postrotate script
running script with arg /var/log/httpd/*log : "
        /bin/systemctl reload httpd.service > /dev/null 2>/dev/null || true
"

rotating pattern: /var/log/iscsiuio.log  weekly (4 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/iscsiuio.log
  log /var/log/iscsiuio.log does not exist -- skipping
not running postrotate script, since no logs were rotated

rotating pattern: /var/log/libvirt/libvirtd.log  weekly (4 rotations)
empty log files are rotated, only log files >= 102400 bytes are rotated, old logs are removed
considering log /var/log/libvirt/libvirtd.log
  log /var/log/libvirt/libvirtd.log does not exist -- skipping

rotating pattern: /var/log/libvirt/qemu/*.log  weekly (4 rotations)
empty log files are rotated, only log files >= 102400 bytes are rotated, old logs are removed
considering log /var/log/libvirt/qemu/*.log
  log /var/log/libvirt/qemu/*.log does not exist -- skipping

rotating pattern: /var/log/numad.log  1048576 bytes (5 rotations)
empty log files are rotated, old logs are removed
considering log /var/log/numad.log
  log /var/log/numad.log does not exist -- skipping

rotating pattern: /var/log/ppp/connect-errors  after 1 days (5 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/account/pacct  after 1 days (31 rotations)
empty log files are not rotated, old logs are removed
considering log /var/account/pacct
  log does not need rotating (log is empty)
rotating pattern: /var/log/rkhunter/rkhunter.log  weekly (4 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/rkhunter/rkhunter.log
  log needs rotating
rotating log /var/log/rkhunter/rkhunter.log, log->rotateCount is 4
dateext suffix '-20180202'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
fscreate context set to unconfined_u:object_r:var_log_t:s0
renaming /var/log/rkhunter/rkhunter.log to /var/log/rkhunter/rkhunter.log-20180202
creating new /var/log/rkhunter/rkhunter.log mode = 0640 uid = 0 gid = 0
removing old log /var/log/rkhunter/rkhunter.log-20170702

rotating pattern: /var/log/samba/*  weekly (4 rotations)
olddir is /var/log/samba/old, empty log files are not rotated, old logs are removed
No logs found. Rotation not needed.

rotating pattern: /var/log/shorewall-init.log  weekly (4 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/shorewall-init.log
  log /var/log/shorewall-init.log does not exist -- skipping

rotating pattern: /var/log/sssd/*.log  weekly (2 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/sssd/*.log
  log /var/log/sssd/*.log does not exist -- skipping
not running postrotate script, since no logs were rotated

rotating pattern: /var/log/cron
/var/log/maillog
/var/log/messages
/var/log/secure
/var/log/spooler
 weekly (4 rotations)
empty log files are rotated, old logs are removed
considering log /var/log/cron
  log needs rotating
considering log /var/log/maillog
  log needs rotating
considering log /var/log/messages
  log needs rotating
considering log /var/log/secure
  log needs rotating
considering log /var/log/spooler
  log needs rotating
rotating log /var/log/cron, log->rotateCount is 4
dateext suffix '-20180202'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
rotating log /var/log/maillog, log->rotateCount is 4
dateext suffix '-20180202'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
rotating log /var/log/messages, log->rotateCount is 4
dateext suffix '-20180202'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
rotating log /var/log/secure, log->rotateCount is 4
dateext suffix '-20180202'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
rotating log /var/log/spooler, log->rotateCount is 4
dateext suffix '-20180202'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
fscreate context set to system_u:object_r:cron_log_t:s0
renaming /var/log/cron to /var/log/cron-20180202
creating new /var/log/cron mode = 0644 uid = 0 gid = 0
fscreate context set to system_u:object_r:var_log_t:s0
renaming /var/log/maillog to /var/log/maillog-20180202
creating new /var/log/maillog mode = 0600 uid = 0 gid = 0
fscreate context set to system_u:object_r:var_log_t:s0
renaming /var/log/messages to /var/log/messages-20180202
creating new /var/log/messages mode = 0600 uid = 0 gid = 0
fscreate context set to system_u:object_r:var_log_t:s0
renaming /var/log/secure to /var/log/secure-20180202
creating new /var/log/secure mode = 0600 uid = 0 gid = 0
fscreate context set to system_u:object_r:var_log_t:s0
renaming /var/log/spooler to /var/log/spooler-20180202
creating new /var/log/spooler mode = 0600 uid = 0 gid = 0
running postrotate script
running script with arg /var/log/cron
/var/log/maillog
/var/log/messages
/var/log/secure
/var/log/spooler
: "
	/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
"
removing old log /var/log/cron-20170702
removing old log /var/log/maillog-20170702
removing old log /var/log/messages-20170702
removing old log /var/log/secure-20170702
removing old log /var/log/spooler-20170702

rotating pattern: /var/log/wpa_supplicant.log  30720 bytes (4 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/wpa_supplicant.log
  log needs rotating
rotating log /var/log/wpa_supplicant.log, log->rotateCount is 4
dateext suffix '-20180202'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
fscreate context set to system_u:object_r:NetworkManager_log_t:s0
renaming /var/log/wpa_supplicant.log to /var/log/wpa_supplicant.log-20180202
creating new /var/log/wpa_supplicant.log mode = 0600 uid = 0 gid = 0
removing old log /var/log/wpa_supplicant.log-20170621

rotating pattern: /var/log/yum.log  yearly (4 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/yum.log
  log needs rotating
rotating log /var/log/yum.log, log->rotateCount is 4
dateext suffix '-20180202'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
fscreate context set to system_u:object_r:rpm_log_t:s0
renaming /var/log/yum.log to /var/log/yum.log-20180202
creating new /var/log/yum.log mode = 0600 uid = 0 gid = 0

rotating pattern: /var/log/wtmp  monthly (1 rotations)
empty log files are rotated, only log files >= 1048576 bytes are rotated, old logs are removed
considering log /var/log/wtmp
  log needs rotating
rotating log /var/log/wtmp, log->rotateCount is 1
dateext suffix '-20180202'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
glob finding old rotated logs failed
fscreate context set to system_u:object_r:wtmp_t:s0
renaming /var/log/wtmp to /var/log/wtmp-20180202
creating new /var/log/wtmp mode = 0664 uid = 0 gid = 22

rotating pattern: /var/log/btmp  monthly (1 rotations)
empty log files are rotated, old logs are removed
considering log /var/log/btmp
  log needs rotating
rotating log /var/log/btmp, log->rotateCount is 1
dateext suffix '-20180202'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
fscreate context set to system_u:object_r:faillog_t:s0
renaming /var/log/btmp to /var/log/btmp-20180202
creating new /var/log/btmp mode = 0600 uid = 0 gid = 22
removing old log /var/log/btmp-20170701

Code: Select all

 sudo ls -la /var/log
total 174228
drwxr-xr-x. 22 root   root        8192 Feb  2 12:29 .
drwxr-xr-x. 24 root   backup      4096 Sep  7 03:39 ..
drwxr-xr-x.  2 root   root        4096 Aug  7  2015 anaconda
drwx------.  2 root   root          94 Feb  1 18:39 audit
-rw-r--r--.  1 boinc  boinc          0 Jun 14  2016 boincerr.log
-rw-rw-r--.  1 boinc  boinc          0 Jun 19  2016 boinc.log
-rw-rw-r--.  1 boinc  boinc       1960 Jan 29  2016 boinc.log-20160129.gz
-rw-rw-r--.  1 boinc  boinc       5400 Mar 16  2016 boinc.log-20160313.gz
-rw-rw-r--.  1 boinc  boinc       2742 Mar 30  2016 boinc.log-20160328.gz
-rw-rw-r--.  1 boinc  boinc     698923 Jun 14  2016 boinc.log-20160619
-rw-r--r--.  2 root   root     6543033 Feb  2 12:29 boot.log
-rw-------.  1 root   utmp        3840 Jan 28 06:33 btmp
-rw-------.  1 root   utmp           0 Jun  1  2017 btmp-20170701
drwxr-xr-x.  2 chrony chrony         6 Aug  3  2017 chrony
-rw-r--r--.  1 root   root     2657899 Feb  2 12:50 cron
-rw-r--r--.  1 root   root        3748 Aug 10  2015 cron-20150810.gz
-rw-r--r--.  1 root   root        5414 Aug 20  2015 cron-20150820.gz
-rw-r--r--.  1 root   root        5524 Aug 23  2015 cron-20150823.gz
-rw-r--r--.  1 root   root        7930 Sep  2  2015 cron-20150902.gz
-rw-r--r--.  1 root   root        1486 Oct  8  2015 cron-20151008.gz
-rw-r--r--.  1 root   root        5816 Oct 11  2015 cron-20151011.gz
-rw-r--r--.  1 root   root       14331 Oct 18  2015 cron-20151018.gz
-rw-r--r--.  1 root   root       16357 Oct 26  2015 cron-20151026.gz
-rw-r--r--.  1 root   root       13142 Nov  1  2015 cron-20151101.gz
-rw-r--r--.  1 root   root       16665 Nov  9  2015 cron-20151109.gz
-rw-r--r--.  1 root   root       12693 Nov 15  2015 cron-20151115.gz
-rw-r--r--.  1 root   root       14969 Nov 22  2015 cron-20151122.gz
-rw-r--r--.  1 root   root       13766 Nov 29  2015 cron-20151129.gz
-rw-r--r--.  1 root   root       16430 Dec  7  2015 cron-20151207.gz
-rw-r--r--.  1 root   root       12892 Dec 13  2015 cron-20151213.gz
-rw-r--r--.  1 root   root       16556 Dec 21  2015 cron-20151221.gz
-rw-r--r--.  1 root   root        7416 Jan 29  2016 cron-20160129.gz
-rw-r--r--.  1 root   root      103972 Jul  2  2017 cron-20170702
-rw-r--r--.  1 root   root      103785 Jul  9  2017 cron-20170709
-rw-r--r--.  1 root   root      103691 Jul 17  2017 cron-20170717
-rw-r--r--.  1 root   root      131872 Jul 27  2017 cron-20170727
drwxr-xr-x.  2 lp     sys         4096 Aug  3  2017 cups
-rw-r--r--.  1 root   root     3291913 Feb  2 12:29 denyhosts
-rw-r--r--.  1 root   root      105637 Jun 29  2017 denyhosts-20170629
-rw-r--r--.  1 root   root      127362 Jul  5  2017 denyhosts-20170705
-rw-r--r--.  1 root   root      105684 Jul 12  2017 denyhosts-20170712
-rw-r--r--.  1 root   root      257736 Jul 27  2017 denyhosts-20170727
-rw-r--r--.  1 root   root       62847 Feb  2 12:29 dmesg
-rw-r--r--.  1 root   root       62727 Feb  2 12:18 dmesg.old
-rw-------.  1 root   root     3870890 Feb  2 12:29 fail2ban.log
-rw-------.  1 root   root         177 Nov 19  2015 fail2ban.log-20151122.gz
-rw-------.  1 root   root        3343 Nov 29  2015 fail2ban.log-20151129.gz
-rw-------.  1 root   root         158 Nov 29  2015 fail2ban.log-20151207.gz
-rw-------.  1 root   root         159 Dec  7  2015 fail2ban.log-20151213.gz
-rw-------.  1 root   root         163 Dec 13  2015 fail2ban.log-20151221.gz
-rw-------.  1 root   root        1080 Jan 29  2016 fail2ban.log-20160129.gz
-rw-------.  1 root   root        2137 Mar 12  2016 fail2ban.log-20160313.gz
-rw-------.  1 root   root       20494 Jul  2  2017 fail2ban.log-20170702
-rw-------.  1 root   root      118539 Jul  9  2017 fail2ban.log-20170709
-rw-------.  1 root   root      137601 Jul 17  2017 fail2ban.log-20170717
-rw-------.  1 root   root      200632 Jul 26  2017 fail2ban.log-20170727
-rw-r--r--.  1 root   root      232151 Feb  2 12:29 firewalld
-rw-rw-r--.  1 root   root           0 Aug  8  2015 freshclam.log
drwx--x--x.  2 root   gdm         4096 Feb  2 12:29 gdm
drwxr-xr-x.  2 root   root           6 Aug  9 13:55 glusterfs
-rw-------.  1 root   root       45336 Jan 28 06:33 grubby
-rw-r--r--.  1 root   root         592 Sep  7 13:39 grubby_prune_debug
drwx------.  2 root   root        4096 Oct 19 16:39 httpd
-rw-r--r--.  1 root   root      310104 Feb  2 12:32 lastlog
drwx------.  3 root   root          17 Jan  4 14:35 libvirt
drwxr-xr-x.  2 root   root          23 Aug  3  2017 mail
-rw-------.  1 root   root    17704393 Feb  2 12:32 maillog
-rw-------.  1 root   root        2413 Aug 10  2015 maillog-20150810.gz
-rw-------.  1 root   root         583 Aug 20  2015 maillog-20150820.gz
-rw-------.  1 root   root         493 Aug 23  2015 maillog-20150823.gz
-rw-------.  1 root   root         576 Sep  2  2015 maillog-20150902.gz
-rw-------.  1 root   root         298 Oct  8  2015 maillog-20151008.gz
-rw-------.  1 root   root         418 Oct 11  2015 maillog-20151011.gz
-rw-------.  1 root   root         931 Oct 18  2015 maillog-20151018.gz
-rw-------.  1 root   root        1018 Oct 26  2015 maillog-20151026.gz
-rw-------.  1 root   root         979 Nov  1  2015 maillog-20151101.gz
-rw-------.  1 root   root         919 Nov  9  2015 maillog-20151109.gz
-rw-------.  1 root   root         733 Nov 15  2015 maillog-20151115.gz
-rw-------.  1 root   root         852 Nov 22  2015 maillog-20151122.gz
-rw-------.  1 root   root        1295 Nov 29  2015 maillog-20151129.gz
-rw-------.  1 root   root         945 Dec  7  2015 maillog-20151207.gz
-rw-------.  1 root   root         771 Dec 13  2015 maillog-20151213.gz
-rw-------.  1 root   root         927 Dec 21  2015 maillog-20151221.gz
-rw-------.  1 root   root         568 Jan 29  2016 maillog-20160129.gz
-rw-------.  1 root   root      169647 Jul  2  2017 maillog-20170702
-rw-------.  1 root   root      511090 Jul  9  2017 maillog-20170709
-rw-------.  1 root   root      447573 Jul 17  2017 maillog-20170717
-rw-------.  1 root   root      782202 Jul 27  2017 maillog-20170727
-rw-------.  1 root   root   110528950 Feb  2 12:51 messages
-rw-------.  1 root   root      219212 Aug 10  2015 messages-20150810.gz
-rw-------.  1 root   root      165259 Aug 20  2015 messages-20150820.gz
-rw-------.  1 root   root       46283 Aug 23  2015 messages-20150823.gz
-rw-------.  1 root   root       69874 Sep  2  2015 messages-20150902.gz
-rw-------.  1 root   root       86873 Oct  8  2015 messages-20151008.gz
-rw-------.  1 root   root       15783 Oct 11  2015 messages-20151011.gz
-rw-------.  1 root   root       79586 Oct 18  2015 messages-20151018.gz
-rw-------.  1 root   root      152459 Oct 26  2015 messages-20151026.gz
-rw-------.  1 root   root       77131 Nov  1  2015 messages-20151101.gz
-rw-------.  1 root   root       46434 Nov  9  2015 messages-20151109.gz
-rw-------.  1 root   root       35569 Nov 15  2015 messages-20151115.gz
-rw-------.  1 root   root       38890 Nov 22  2015 messages-20151122.gz
-rw-------.  1 root   root      188514 Nov 29  2015 messages-20151129.gz
-rw-------.  1 root   root       59449 Dec  7  2015 messages-20151207.gz
-rw-------.  1 root   root       45351 Dec 13  2015 messages-20151213.gz
-rw-------.  1 root   root       49471 Dec 21  2015 messages-20151221.gz
-rw-------.  1 root   root       47503 Jan 29  2016 messages-20160129.gz
-rw-------.  1 root   root     2667406 Jul  2  2017 messages-20170702
-rw-------.  1 root   root     3974524 Jul  9  2017 messages-20170709
-rw-------.  1 root   root     3747798 Jul 17  2017 messages-20170717
-rw-------.  1 root   root     5132900 Jul 27  2017 messages-20170727
drwxr-xr-x.  2 ntp    ntp            6 Apr 12  2017 ntpstats
drwxr-xr-x.  3 root   root          17 Aug  7  2015 pluto
-rw-r--r--.  1 root   root           0 Mar 12  2016 pm-powersave.log
drwx------.  2 root   root           6 Jun 10  2014 ppp
drwxr-xr-x.  2 root   root           6 Aug  4 03:33 qemu-ga
drwxr-xr-x.  2 root   root        4096 Aug 12 15:32 rkhunter
drwxr-xr-x.  2 root   root        4096 Jan 29 06:10 sa
drwx------.  3 root   root          16 Nov 27 11:21 samba
-rw-------.  1 root   root     1973703 Feb  2 12:55 secure
-rw-------.  1 root   root        5690 Aug 10  2015 secure-20150810.gz
-rw-------.  1 root   root        2167 Aug 20  2015 secure-20150820.gz
-rw-------.  1 root   root        1005 Aug 22  2015 secure-20150823.gz
-rw-------.  1 root   root         959 Sep  2  2015 secure-20150902.gz
-rw-------.  1 root   root        1063 Oct  8  2015 secure-20151008.gz
-rw-------.  1 root   root         645 Oct 10  2015 secure-20151011.gz
-rw-------.  1 root   root        1076 Oct 14  2015 secure-20151018.gz
-rw-------.  1 root   root        1840 Oct 26  2015 secure-20151026.gz
-rw-------.  1 root   root         986 Oct 31  2015 secure-20151101.gz
-rw-------.  1 root   root         148 Nov 18  2015 secure-20151119.gz
-rw-------.  1 root   root         210 Nov 20  2015 secure-20151122.gz
-rw-------.  1 root   root        1073 Nov 29  2015 secure-20151129.gz
-rw-------.  1 root   root        1477 Dec  7  2015 secure-20151207.gz
-rw-------.  1 root   root        1184 Dec 13  2015 secure-20151213.gz
-rw-------.  1 root   root        1534 Dec 21  2015 secure-20151221.gz
-rw-------.  1 root   root        1013 Jan 29  2016 secure-20160129.gz
-rw-------.  1 root   root       18661 Jul  2  2017 secure-20170702
-rw-------.  1 root   root       34397 Jul  9  2017 secure-20170709
-rw-------.  1 root   root       19907 Jul 17  2017 secure-20170717
-rw-------.  1 root   root       25568 Jul 27  2017 secure-20170727
drwx------.  2 root   root           6 Jun  9  2014 speech-dispatcher
-rw-------.  1 root   root           0 Jul 27  2017 spooler
-rw-------.  1 root   root           0 Jun 25  2017 spooler-20170702
-rw-------.  1 root   root           0 Jul  2  2017 spooler-20170709
-rw-------.  1 root   root           0 Jul  9  2017 spooler-20170717
-rw-------.  1 root   root           0 Jul 17  2017 spooler-20170727
drwxr-x---.  2 sssd   sssd           6 Dec  5 10:35 sssd
-rw-------.  1 root   root           0 Aug  7  2015 tallylog
drwxr-xr-x.  2 root   root        4096 Jan 25 02:01 teamviewer12
drwxr-xr-x.  2 root   root          58 Jan 25 11:01 tuned
-rw-r--r--.  1 root   root     5485026 Jan 28 10:49 vbox-install.log
-rw-------.  1 root   root      952346 Feb  2 12:29 wpa_supplicant.log
-rw-r--r--.  1 root   root         586 Aug 10  2015 wpa_supplicant.log-20150810.gz
-rw-------.  1 root   root         772 Aug 21  2015 wpa_supplicant.log-20150820.gz
-rw-------.  1 root   root         549 Aug 23  2015 wpa_supplicant.log-20150823.gz
-rw-------.  1 root   root        1733 Oct 21  2015 wpa_supplicant.log-20151018.gz
-rw-------.  1 root   root        3153 Nov 27  2015 wpa_supplicant.log-20151107.gz
-rw-------.  1 root   root        1502 Dec 24  2015 wpa_supplicant.log-20151130.gz
-rw-------.  1 root   root      117320 Jun 23  2017 wpa_supplicant.log-20170621
-rw-------.  1 root   root       31572 Jul  3  2017 wpa_supplicant.log-20170703
-rw-------.  1 root   root       42508 Jul  9  2017 wpa_supplicant.log-20170709
-rw-------.  1 root   root       50371 Jul 27  2017 wpa_supplicant.log-20170727
-rw-rw-r--.  1 root   utmp     2215296 Feb  2 12:51 wtmp
-rw-r--r--.  1 root   root       56608 Feb  2 12:51 Xorg.0.log
-rw-r--r--.  1 root   root       60867 Feb  2 12:28 Xorg.0.log.old
-rw-r--r--.  1 root   root       64619 Oct  8 18:31 Xorg.1.log
-rw-r--r--.  1 root   root        9308 Jul 16  2017 Xorg.1.log.old
-rw-------.  1 root   root      276047 Feb  2 12:27 yum.log
-rw-------.  1 root   root       48597 Nov 20  2015 yum.log-20160129
Last edited by lightman47 on 2018/02/02 18:02:55, edited 1 time in total.

User avatar
TrevorH
Site Admin
Posts: 33219
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: logrotate stopped working last July

Post by TrevorH » 2018/02/02 17:55:42

Try running the commands that are in /etc/cron.daily/logrotate manually, possibly adding the -d switch so that it tells you everything it would do but does nothing. Also check the files in /etc/logrotate.d for syntax errors.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

lightman47
Posts: 1522
Joined: 2014/05/21 20:16:00
Location: Central New York, USA

Re: logrotate stopped working last July

Post by lightman47 » 2018/02/02 18:24:13

OK - I manually ran /usr/sbin/logrotate -s /var/lib/logrotate/logrotate.status /etc/logrotate.conf and everything rotated as it should. (I got excited and forgot the '-d' switch - drat!). I also checked one or two of the files (which I've never edited) in logrotate.d and to me it looked good.

- why is starting to smell like a permission 'thing'? What could I have clobbered? The only 'cron stuff' I ever edit is /etc/crontab, and this is done via a script that calls sudo emacs to edit it, then (sudo) chmods it back to 644, restorecons the file, and finally restarts crond. I don't recall editing any other cron things.

cronEdit.sh:

Code: Select all

# cronEdit.sh
sudo emacs /etc/crontab
sudo chmod 644 /etc/crontab
sudo restorecon /etc/crontab
sudo systemctl restart crond
Hmm

lightman47
Posts: 1522
Joined: 2014/05/21 20:16:00
Location: Central New York, USA

Re: logrotate stopped working last July

Post by lightman47 » 2018/02/02 18:27:06

HANG ON!!

I may have found it!
---
My bad (excited again) - it turns out the permissions in cron.daily and cron.d are the same as on my server - whose logrotate is working. We're back to "what could I have clobbered".
Thank you

lightman47
Posts: 1522
Joined: 2014/05/21 20:16:00
Location: Central New York, USA

Re: logrotate stopped working last July

Post by lightman47 » 2018/02/02 19:20:19

OK - it IS a permission 'thing'! My /var/log permissions are messed - according to permissions on my servers that rotate just fine. (I now think I remember this "incident" where I chmod'ed '*.*' while thinking I was in cgi-bin after an "ls -la /var/www/cgi-bin"}. It was ugly getting programs to run again!

That said - (I think I already know the answer) - Do I need to actually do the 'big ugly' and compare directories and chmod everything one-at-a-time, or perhaps a script to reset /var/log permissions exits somewhere,somehow?

Thank goodness it's only my development laptop where I did this as SU - which I generally avoid.

Thank you.

P.S. Not worth a re-install yet, but close! AND - if I need do it manually, there'll be a script on my network for future stupidities.

User avatar
TrevorH
Site Admin
Posts: 33219
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: logrotate stopped working last July

Post by TrevorH » 2018/02/02 19:55:08

for p in $(rpm -qa); do rpm --setperms $p; rpm --setugids $p; done

will set the correct permissions as defined in the rpm database for all files owned by all rpms.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

desertcat
Posts: 843
Joined: 2014/08/07 02:17:29
Location: Tucson, AZ

Re: logrotate stopped working last July

Post by desertcat » 2018/02/02 22:55:10

lightman47 wrote:OK - it IS a permission 'thing'! My /var/log permissions are messed - according to permissions on my servers that rotate just fine. (I now think I remember this "incident" where I chmod'ed '*.*' while thinking I was in cgi-bin after an "ls -la /var/www/cgi-bin"}. It was ugly getting programs to run again!

That said - (I think I already know the answer) - Do I need to actually do the 'big ugly' and compare directories and chmod everything one-at-a-time, or perhaps a script to reset /var/log permissions exits somewhere,somehow?

Thank goodness it's only my development laptop where I did this as SU - which I generally avoid.

Thank you.

P.S. Not worth a re-install yet, but close! AND - if I need do it manually, there'll be a script on my network for future stupidities.

:lol: :lol: :lol: Too funny, but I managed to do something very similar over the Holiday Season. I chmod'ed my way into changing the sticky bit on my root Password, and lost all access to root. Had way too much Holiday Cheer!! It's great when we can laugh at our own stupidities. Hope all is well now.

DesertCat

lightman47
Posts: 1522
Joined: 2014/05/21 20:16:00
Location: Central New York, USA

Re: logrotate stopped working last July

Post by lightman47 » 2018/02/02 23:35:01

Uh, oh -

the still growing lengthy list of "cannot access" ... "No such file or directory" is not comforting.

EDIT - Oh, its complaining about removed packages - perhaps I am not in trouble after all!

lightman47
Posts: 1522
Joined: 2014/05/21 20:16:00
Location: Central New York, USA

Re: logrotate stopped working last July

Post by lightman47 » 2018/02/03 00:16:28

After completion, I suspect I am hosed;

Code: Select all

$ sudo cat /var/log/messages
sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set
[eganj@leganjhp ~]$ su
Password: 
su: Authentication failure
EDIT: ------------------
This was easily fixed, it turns out

Edit boot entry to add runlevel 1 to end of the line
Supply root password
chown root:root /usr/bin/sudo
chmod 4755 /usr/bin/sudo
chown root:root /usr/bin/su
chmod 4755 /usr/bin/su
systemctl reboot

Post Reply