[bug] Wrong permissions on /etc/logotate.d/directadmin, etc

zEitEr

Super Moderator
Joined
Apr 11, 2005
Messages
15,366
Location
www.poralix.com
Hello

It was noticed on the latest Debian release of wheeze, the files /etc/logrotate.d/directadmin and /etc/logrotate.d/exim have wrong permissions 755, that gives error with logrotate:

Code:
Ignoring directadmin because of bad file mode

and the logfiles are skipped during log rotation. To fix it the files should be chmod'ed to 644.

Related discussion can be found: http://forum.directadmin.com/showthread.php?t=49621

And I'd suggest to add

Code:
nooldir

option into

/etc/logrotate.d/webapps

in case if someone has olddir specified
 
I noticed the same issue on a CentOS 7 system that was installed around december, /etc/logrotate.d/exim was 755 instead of 644 and the logfiles were not rotated. So I guess this also needs to be fixed for CentOS 7.

Edit: I just noticed this has already been fixed for upcoming 1.47.1 :)
https://www.directadmin.com/features.php?id=1729
 
Last edited:
Somehow after latest update EXIM (CENTOS 7x)
Directadmin and custombuild latest production versions

This error is here anacron logrotate
/etc/cron.daily/logrotate:


error: Ignoring exim because of bad file mode - must be 0644 or 0444.
 
Thanks for the report!

Looking through custombuild, it makes no reference to /etc/logrotate.d/exim.
If my memory is correct, it's installed with the rpm only, and never touched after that. Couldn't find it on files1 either, so not a "dynamic" file (not installed or updated by CB)

The "fix" is to set it to 644 manually.. but I cannot find any reason in the update script that it would have been changed.

Digging further.. I noticed it's set to 755 everywhere on our build boxes, etc .. so it's likely been that way the whole time.
What likely changed (perhaps) was an update to the rules and restrictions put in place by logrotate itself.

I've updated build to check for 755, and set to 644 for any exim compile, eg:
Code:
    EXIM_LOGROTATE=/etc/logrotate.d/exim
    if [ -s ${EXIM_LOGROTATE} ]; then
        if [ "`/usr/bin/stat -c "%a" ${EXIM_LOGROTATE}`" = "755" ]; then
            echo "${EXIM_LOGROTATE} was set to 755. Changed to 644"
            chmod 644 ${EXIM_LOGROTATE}
        fi
    fi
Seems to be working :)
Code:
...
Exim installation complete
Moving exim binary.
/etc/logrotate.d/exim was set to 755. Changed to 644
Exim 4.91 Installed.
Restarting exim.
Shutting down exim:
Starting exim:
[root@test custombuild]# ll /etc/logrotate.d/exim
-rw-r--r-- 1 644 root 112 Jul 19  2011 /etc/logrotate.d/exim
[root@test custombuild]#


John
 
Back
Top