Skip to content Skip to sidebar Skip to footer

Setting Logrotate im Got Error Because Parent Directory has Insecure Permissions

I'm currently tidying up the existing logs where I take the original logs and rotate them to any folder I want, but there was a problem when I tried to manually simulate this simulation would be applied before the system automatically ran it.

Issue

When I command the command run logrotate :

# /usr/sbin/logrotate -f -v -s /var/lib/logrotate/logrotate.status /etc/logrotate.conf

It raises an error that makes the logrotate not work as expected

# error: skipping "/usr/local/zend/var/log/access.log" 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.
because parent directory has insecure permissions
because parent directory has insecure permissions


Cause

As seen above the error output is clear because of "Permissions" and we have been advised to "Set su" or add privileges to the configuration we made earlier :
# cat /etc/logrotate.d/zend

 /usr/local/zend/var/log/*.log {
    olddir /apps/data/KitsakeLog/daily/zend
        daily
        rotate 7
    missingok
    lastaction
        /etc/logrotate.d/scripts/zend-ownership.sh
    endscript
}

 

Resolution

And here I try to enter "su root root" in the zend log configuration :

# vi /etc/logrotate.d/zend

/usr/local/zend/var/log/*.log {
    su root root
    olddir /apps/data/KitsakeLog/daily/zend
        daily
        rotate 7
    missingok
    lastaction
        /etc/logrotate.d/scripts/zend-ownership.sh
    endscript
}

Save & exit

 

Trying

And now try the simulation again by manual hit to logrotate :

# /usr/sbin/logrotate -f -v -s /var/lib/logrotate/logrotate.status /etc/logrotate.conf
trying simulate after configured
trying simulate after configured

result of logrotate zend
result of logrotate zend

Bangkit Ade Saputra
Bangkit Ade Saputra Hard-working professional with experience and a proven knowledge of operating system, server architecture and system configuration.

Post a Comment for "Setting Logrotate im Got Error Because Parent Directory has Insecure Permissions"