error: Ignoring /etc/logrotate.conf because it is writable by group or others
Asked Answered
D

1

6

error: Ignoring /etc/logrotate.conf because it is writable by group or others

I got this error from my crontab log

4 -rw-r--r-- 1 root root 520 Mar 27 12:15 logrotate.conf

I am given 644 for logrotate.conf, how can I solve this issue?

Disembark answered 30/4, 2019 at 6:44 Comment(5)
What are the perms on your /etc directory?Niklaus
4 -rw-r--r-- 1 root root 520 Mar 27 12:15 /etc/logrotate.conf 4 drwxr-xr-x 1 root root 4096 Apr 5 05:47 /etc/logrotate.d these are the perms for logrotateDisembark
This error is generally misleading. Since the directive to include any configuration files found in /etc/logrotate.d/ is given in /etc/logrotate.conf, any file permission issues inside the /etc/logrotate.d/ directory are going to be reported as stemming from /etc/logrotate.conf, like we see here. You need to verify a 644 mask on all the configuration files inside of /etc/logrotate.d/ as well.Niklaus
@Niklaus this way only root is able to write to that log file so you are "forced" to run your application with root as well and this can lead to security issues.. How is the application supposed to append data to log files then?Kerouac
I answer myself: I were trying to tell logrotate to force rotation over the log file itself while it expects logrotate configuration file as its parameter. Pointing to configuration file it gives this other error which is so self explainatory: «error: skipping "/var/log/foo.log" because [...] Set "su" directive in config file to tell logrotate which user/group should be used for rotation.»Kerouac
M
11

Give chmod 644 to the file placed in logrotate.d folder.

Mt answered 14/11, 2019 at 5:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.