View Issue Details

IDProjectCategoryView StatusLast Update
0016513CentOS-6crontabspublic2019-10-03 11:44
Reporterdwall 
PriorityhighSeverityminorReproducibilityhave not tried
Status newResolutionopen 
PlatformOSCentOS 6.10OS Version2.6.32-754.23.1
Product Version6.10 
Target VersionFixed in Version 
Summary0016513: cron.daily unknown option 'su'
Description


I have two different machines that were patched to 2.6.32-754.23.1.el6.x86_64 yesterday. Today I received the below emails when cron.daily ran.
-----Original Message-----
From: Anacron <root@nagiosxi.kansys.com>
Sent: Tuesday, October 1, 2019 03:30
To: root@nagiosxi.kansys.com
Subject: Anacron job 'cron.daily' on nagiosxi.kansys.local

/etc/cron.daily/logrotate:

error: nagiosxi:14 unknown option 'su' -- ignoring line
error: nagiosxi:14 unexpected text
error: nagiosxi:24 unknown option 'su' -- ignoring line
error: nagiosxi:24 unexpected text
----------------------------------------------------------------------------------------------
-----Original Message-----
From: Anacron <root@nagiosxi.newcomobile.com>
Sent: Tuesday, October 1, 2019 02:08
To: root@nagiosxi.newcomobile.com
Subject: Anacron job 'cron.daily' on nagiosxi.newcomobile.com

/etc/cron.daily/logrotate:

error: nagiosxi:14 unknown option 'su' -- ignoring line
error: nagiosxi:14 unexpected text
error: nagiosxi:24 unknown option 'su' -- ignoring line
error: nagiosxi:24 unexpected text
Steps To ReproduceI have not tried to reproduce it.
Additional InformationOriginally I thought it was because I had just created cron.allow to tighten things up, until I saw that It was only created on the kansy.com server, and not the newcomobile.com
TagsNo tags attached.

Activities

dwall

dwall

2019-10-01 13:10

reporter   ~0035284

I attempted to run "sudo logrotate /etc/logrotate.conf" but nagios is not allow to execute as root.
dwall

dwall

2019-10-02 14:17

reporter   ~0035295

Cron can be run for other things, it just seems to not allow the logrotate.


-----Original Message-----
From: Cron Daemon <root@nagiosxi.kansys.com>
Sent: Wednesday, October 2, 2019 07:00
To: root@nagiosxi.kansys.com
Subject: Cron <root@nagiosxi> /root/scripts/automysqlbackup

======================================================================
AutoMySQLBackup VER 2.5
http://sourceforge.net/projects/automysqlbackup/

Backup of Database Server - nagiosxi.kansys.local
======================================================================
Backup Start Time Wed Oct 2 07:00:01 CDT 2019
======================================================================
Daily Backup of Database ( nagios )
Rotating last weeks Backup...
removed `/store/backups/mysql/daily/nagios/nagios_2019-09-25_07h00m.Wednesday.sql.gz'


Backup Information for /store/backups/mysql/daily/nagios/nagios_2019-10-02_07h00m.Wednesday.sql
         compressed uncompressed ratio uncompressed_name
            8919643 71113156 87.5% /store/backups/mysql/daily/nagios/nagios_2019-10-02_07h00m.Wednesday.sql
----------------------------------------------------------------------
Daily Backup of Database ( nagiosql )
Rotating last weeks Backup...
removed `/store/backups/mysql/daily/nagiosql/nagiosql_2019-09-25_07h00m.Wednesday.sql.gz'


Backup Information for /store/backups/mysql/daily/nagiosql/nagiosql_2019-10-02_07h00m.Wednesday.sql
         compressed uncompressed ratio uncompressed_name
              95117 806810 88.2% /store/backups/mysql/daily/nagiosql/nagiosql_2019-10-02_07h00m.Wednesday.sql
----------------------------------------------------------------------
Backup End Wed Oct 2 07:00:07 CDT 2019
======================================================================
Total disk space used for backup storage..
Size - Location
306M /store/backups/mysql

======================================================================
If you find AutoMySQLBackup valuable please make a donation at
http://sourceforge.net/project/project_donations.php?group_id=101066
======================================================================
ellert

ellert

2019-10-03 07:24

reporter   ~0035302

The logrotate version in CentOS 6 is quite old, and does not support the su option. This is not a bug in crontab.
dwall

dwall

2019-10-03 11:35

reporter   ~0035304

This just showed up after updating the O/S 2.6.32-754.23.1.el6.x86_64. I found other bugs similar to this. The only thing has changed is the system update. Nothing was changed to any cron or logrotate files.
Take a look at:
https://bugzilla.redhat.com/show_bug.cgi?id=1202602
https://bugzilla.redhat.com/show_bug.cgi?id=1330244
https://www.centos.org/forums/viewtopic.php?t=58276
https://kc.mcafee.com/corporate/index?page=content&id=KB85800&snspd-1115
dwall

dwall

2019-10-03 11:44

reporter   ~0035305

1024 root@nagiosxi:/etc # cat anacrontab
# /etc/anacrontab: configuration file for anacron

# See anacron(8) and anacrontab(5) for details.

SHELL=/bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
# the maximal random delay added to the base delay of the jobs
RANDOM_DELAY=45
# the jobs will be started during the following hours only
START_HOURS_RANGE=3-22

#period in days delay in minutes job-identifier command
1 5 cron.daily nice run-parts /etc/cron.daily
7 25 cron.weekly nice run-parts /etc/cron.weekly
@monthly 45 cron.monthly nice run-parts /etc/cron.monthly

1042 root@nagiosxi:/etc/cron.daily # cat logrotate
#!/bin/sh

/usr/sbin/logrotate /etc/logrotate.conf
EXITVALUE=$?
if [ $EXITVALUE != 0 ]; then
    /usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
fi
exit 0

1043 root@nagiosxi:/etc/cron.daily # 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.
1046 root@nagiosxi:/etc/logrotate.d # ls -alrt
total 44
-rw-r--r--. 1 root root 276 May 19 2009 snmptt
-rw-rw-r--. 1 root root 135 Jan 17 2016 ConsoleKit
-rw-r--r--. 1 root root 871 Jan 26 2017 mysqld
-rw-r--r--. 1 root root 388 Mar 22 2017 psacct
-rw-r--r--. 1 root root 210 Dec 1 2017 syslog
-rw-r--r--. 1 root root 185 Feb 19 2018 httpd
-rw-r--r--. 1 root root 139 Jun 19 2018 dracut
-rw-r--r--. 1 root root 87 Oct 10 2018 yum
-rw-r--r--. 1 root root 431 Sep 30 06:53 nagiosxi
drwxr-xr-x. 2 root root 4096 Sep 30 06:53 .
drwxr-xr-x. 91 root root 4096 Oct 1 07:30 ..
1047 root@nagiosxi:/etc/logrotate.d # cat nagiosxi
/usr/local/nagiosxi/var/*log {
    missingok
    notifempty
    size 5M
    rotate 1
    compress
}

/usr/local/nagiosxi/var/xidebug.log {
    missingok
    notifempty
    size 100M
    create 0660 apache nagios
    su apache nagios
    rotate 1
    compress
}

/usr/local/nagiosxi/var/xidebug.log.backtrace {
    missingok
    notifempty
    size 100M
    create 0660 apache nagios
    su apache nagios
    rotate 1
    compress
}1048 root@nagiosxi:/etc/logrotate.d #

Issue History

Date Modified Username Field Change
2019-10-01 12:56 dwall New Issue
2019-10-01 13:10 dwall Note Added: 0035284
2019-10-02 14:17 dwall Note Added: 0035295
2019-10-03 07:24 ellert Note Added: 0035302
2019-10-03 11:35 dwall Note Added: 0035304
2019-10-03 11:44 dwall Note Added: 0035305