Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem:
Upon installation of Satellite 6.1.2, MongoDB logs are directed to /var/lib/mongodb which automatically assigned them the selinux context: mongod_var_lib_t.
This prevents the logs from being managed by logrotate even though Satellite provides configuration for them to be rotated.
Version-Release number of selected component (if applicable): Satellite 6.1.2
How reproducible: 100%
Steps to Reproduce:
1. Install Satellite 6.1.2.
2. Observe that mongodb logs are placed in /var/lib/mongodb
Actual results: Logs for MongoDB placed in /var/lib/mongodb, wrong selinux context applied. logrotate is setup to control logs in /var/log/mongodb. To have correct logrotate, customer would need to configure the logpath correctly in /etc/mongodb.conf.
They receive selinux context based on this rule:
/var/lib/mongo.* all files system_u:object_r:mongod_var_lib_t:s0
Rule for the logs:
/var/log/mongo.* all files system_u:object_r:mongod_log_t:s0
Expected results: MongoDB logs should be pushed to /var/log/mongodb, as this would solve any selinux context issues and work with the current implementation of /etc/logrotate.d/mongodb.
Additional info:
Appears that the logpatch is configured via puppet during install:
class { 'mongodb':
logpath => '/var/lib/mongodb/mongodb.log',
dbpath => '/var/lib/mongodb',
pidfilepath => $mongodb_pidfilepath,
} ~>
This should now be handled properly with the newer pulp puppet module. I verified on an installation it was logging to the correct place and log rotate was occuring.
Also to note, the files in this new location appear to have the correct selinux context:
[root@sat-r220-04 ~]# ls -lZ /var/log/mongodb/
-rw-r--r--. mongodb mongodb system_u:object_r:mongod_log_t:s0 mongodb.log
-rw-r--r--. mongodb mongodb system_u:object_r:mongod_log_t:s0 mongodb.log.2016-03-12T18-29-57
-rw-r--r--. mongodb mongodb system_u:object_r:mongod_log_t:s0 mongodb.log-20160313
-rw-r--r--. mongodb mongodb system_u:object_r:mongod_log_t:s0 mongodb.log.2016-03-13T07-14-03
Logs go to right place, with right context:
[root@sat-r220-06 mongodb]# ls -lZ /var/log/mongodb/
-rw-r--r--. mongodb mongodb system_u:object_r:mongod_log_t:s0 mongodb.log
-rw-r--r--. mongodb mongodb system_u:object_r:mongod_log_t:s0 mongodb.log.2016-03-24T16-12-24
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHBA-2016:1500
Description of problem: Upon installation of Satellite 6.1.2, MongoDB logs are directed to /var/lib/mongodb which automatically assigned them the selinux context: mongod_var_lib_t. This prevents the logs from being managed by logrotate even though Satellite provides configuration for them to be rotated. Version-Release number of selected component (if applicable): Satellite 6.1.2 How reproducible: 100% Steps to Reproduce: 1. Install Satellite 6.1.2. 2. Observe that mongodb logs are placed in /var/lib/mongodb Actual results: Logs for MongoDB placed in /var/lib/mongodb, wrong selinux context applied. logrotate is setup to control logs in /var/log/mongodb. To have correct logrotate, customer would need to configure the logpath correctly in /etc/mongodb.conf. They receive selinux context based on this rule: /var/lib/mongo.* all files system_u:object_r:mongod_var_lib_t:s0 Rule for the logs: /var/log/mongo.* all files system_u:object_r:mongod_log_t:s0 Expected results: MongoDB logs should be pushed to /var/log/mongodb, as this would solve any selinux context issues and work with the current implementation of /etc/logrotate.d/mongodb. Additional info: Appears that the logpatch is configured via puppet during install: class { 'mongodb': logpath => '/var/lib/mongodb/mongodb.log', dbpath => '/var/lib/mongodb', pidfilepath => $mongodb_pidfilepath, } ~>