Anacron job 'cron.daily' logrotate
Posted: Fri Oct 02, 2015 8:02 am
seems there is a small issue with /etc/logrotate.d/nagioslogserver. the 2015R2.2 release produces the following errors when the cron runs. Believe this was an issue with the version prior as well.
I receive all root email and this is output.
Basically the file is in Windows line ending format instead of unix, there is ways to correct this, however this method below is the quickest way to resolve.
root@localhost:~/# file /etc/logrotate.dnagioslogserver
nagioslogserver: ASCII text, with CRLF line terminators
root@localhost:~/# yum install dos2unix -y
Loaded plugins: package_upload, product-id, security, subscription-manager
Setting up Install Process
...
Installed:
dos2unix.x86_64 0:3.1-37.el6
Complete!
root@localhost:~/# dos2unix /etc/logrotate.d/nagioslogserver
dos2unix: converting file nagioslogserver to UNIX format ...
root@localhost:~/# file /etc/logrotate.d/nagioslogserver
/etc/logrotate.d/nagioslogserver: ASCII text
Nagios Support, can you file this as a bug and have corrected in the next version so we don't have to keep correcting this after upgrades.
I receive all root email and this is output.
Code: Select all
/etc/cron.daily/logrotate:
error: nagioslogserver:1 lines must begin with a keyword or a filename (possibly in double quotes)
error: nagioslogserver:2 unexpected text
error: nagioslogserver:3 unexpected text
error: nagioslogserver:4 unexpected text
error: nagioslogserver:5 unexpected text
error: nagioslogserver:6 unexpected text
error: nagioslogserver:7 unexpected text
error: nagioslogserver:8, unexpected text after {
error: nagioslogserver:8 lines must begin with a keyword or a filename (possibly in double quotes)
error: nagioslogserver:9 lines must begin with a keyword or a filename (possibly in double quotes)
error: nagioslogserver:10 lines must begin with a keyword or a filename (possibly in double quotes)
error: nagioslogserver:11 unexpected text
error: nagioslogserver:12 unexpected text
error: nagioslogserver:13 unexpected text
error: nagioslogserver:14 unexpected text
error: nagioslogserver:15 unexpected text
error: nagioslogserver:16 unexpected text
error: nagioslogserver:17, unexpected text after {
error: nagioslogserver:17 lines must begin with a keyword or a filename (possibly in double quotes)root@localhost:~/# file /etc/logrotate.dnagioslogserver
nagioslogserver: ASCII text, with CRLF line terminators
root@localhost:~/# yum install dos2unix -y
Loaded plugins: package_upload, product-id, security, subscription-manager
Setting up Install Process
...
Installed:
dos2unix.x86_64 0:3.1-37.el6
Complete!
root@localhost:~/# dos2unix /etc/logrotate.d/nagioslogserver
dos2unix: converting file nagioslogserver to UNIX format ...
root@localhost:~/# file /etc/logrotate.d/nagioslogserver
/etc/logrotate.d/nagioslogserver: ASCII text
Nagios Support, can you file this as a bug and have corrected in the next version so we don't have to keep correcting this after upgrades.