error with logrotate that it has insecure permissions
This document (7005219) is provided subject to the disclaimer at the end of this document.
Environment
SUSE Linux Enterprise Server 11 Service Pack 2
SUSE Linux Enterprise Server 10 Service Pack 4
Situation
error: "/var/lib/mailman/logs" has insecure permissions. It must be owned and be writable by root only to avoid security problems. Set the "su" directive in the config file to tell logrotate which user/group should be used for rotation.
When mysql has been installed, the following message in /var/log/messages:
error: "/var/lib/mysql" has insecure permissions. It must be owned and be writable by root only to avoid security problems. Set the "su" directive in the config file to tell logrotate which user/group should be used for rotation.
When tomcat5 has been installed, the following message in /var/log/messages:
error: "/var/log/tomcat/base" has insecure permissions. It must be owned and be writable by root only to avoid security problems. Set the "su" directive in the config file to tell logrotate which user/group should be used for rotation.
error: "/var/log/tomcat/base" has insecure permissions. It must be owned and be writable by root only to avoid security problems. Set the "su" directive in the config file to tell logrotate which user/group should be used for rotation.
These errors can also occur with other packages.
Resolution
To solve the cause of the messages, add "su pkg_user pkg_group" in every section of the /etc/logrotate.d/<package> file.
As an example, there are 2 sections in /etc/logrotate.d/tomcat5. Therefore, the "su tomcat tomcat" would need to be added to both section -- viz:
/var/log/tomcat5/base/*.txt {
su tomcat tomcat
notifempty
copytruncate
weekly
rotate 52
compress
missingok
}
/var/log/tomcat5/base/catalina.out {
su tomcat tomcat
notifempty
copytruncate
weekly
rotate 52
compress
missingok
}
For mailman, update each section in /etc/logrotate.d/mailman with the following:
su mailman mailman
The same for mysql. Add the following to every section in /etc/logrotate.d/mysql :
su mysql mysql
If the messages occur for other packages, add the user/group owner of the directory or file to the appropriate file in /etc/logrotate.d/
Additional Information
Disclaimer
This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.
- Document ID:7005219
- Creation Date: 26-Apr-2012
- Modified Date:12-Oct-2022
-
- SUSE Linux Enterprise Server
For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com