Bug 728697
| Summary: | Bacula uses /var/spool/bacula/log rather /var/log/bacula.log by default as log file | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | Robert Scheck <redhat-bugzilla> |
| Component: | bacula | Assignee: | Lukáš Nykrýn <lnykryn> |
| Status: | CLOSED ERRATA | QA Contact: | Tomas Dolezal <todoleza> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 6.1 | CC: | azelinka, bsingh, mgrepl, ovasik, rdassen, robert.scheck, todoleza |
| Target Milestone: | rc | Keywords: | SELinux |
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | bacula-5.0.0-10.el6 | Doc Type: | Bug Fix |
| Doc Text: |
Cause:
Bacula creates itself /var/spool/bacula/log.
Consequence:
/var/spool/bacula/log has wrong selinux context.
Fix:
Create /var/spool/bacula/log in package.
Result:
/var/spool/bacula/log has correct selinux context.
|
Story Points: | --- |
| Clone Of: | Environment: | ||
| Last Closed: | 2012-11-19 04:15:08 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 782183, 840699 | ||
I have cross-filed case 00515390 for this issue in the Red Hat customer portal. This request was evaluated by Red Hat Product Management for inclusion in the current release of Red Hat Enterprise Linux. Because the affected component is not scheduled to be updated in the current release, Red Hat is unfortunately unable to address this request at this time. Red Hat invites you to ask your support representative to propose this request, if appropriate and relevant, in the next release of Red Hat Enterprise Linux. If you would like it considered as an exception in the current release, please ask your support representative. Filled as case 00545706 as well, because affects another customer, too. Same for case 00547366, yet another customer. I really don't want to move location of log file, for example it can break some monitoring scripts. Are there some concrete issues, which are caused by this location? 1. It's an FHS violation - that should be already reason enough 2. SELinux policy causes AVC denied for at least logwatch + logrotate, because it's labeled with var_spool_t instead of var_log_t 1. You can take messages from this log as unread mail, this file contains all mails sended to administrator. 2. Added mgrepl to CC We have in the policy /var/spool/bacula/log(/.*)? gen_context(system_u:object_r:var_log_t,s0) Is "/var/spool/bacula/log" owned by the bacula package? In which version of the policy? That version that comes with RHEL 6.1 with all standard updates? (In reply to comment #9) > We have in the policy > > /var/spool/bacula/log(/.*)? gen_context(system_u:object_r:var_log_t,s0) > > Is "/var/spool/bacula/log" owned by the bacula package? Only dir /var/spool/bacula is included in package. All files in it aren't. RHEL6.2 policy which you can grab from http://people.redhat.com/dwalsh/SELinux/RHEL6/noarch/ That is not really the RHEL 6.2 policy, that is latest build which likely gets in RHEL 6.2, but from what I know in the past, it should not be used for productive environments so far - right? I think that easiest solution, would be to include this file to bacula-common package. Then if you install bacula it will create empty file with correct selinux context and logwatch and logrotate will be able to work with it. Disadvantage of this solution is that when you uninstall bacula it will also remove this file, but this can be bypassed by making copy of it in uninstall process. 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. http://rhn.redhat.com/errata/RHBA-2012-1469.html |
Description of problem: Bacula uses "/var/spool/bacula/log" rather "/var/log/bacula.log" by default as log file. From my point this violates FHS, because logs should go to /var/log instead of /var/spool. This might even be caused by a broken upstream default. Version-Release number of selected component (if applicable): bacula-director-common-5.0.0-7.el6.x86_64 bacula-client-5.0.0-7.el6.x86_64 bacula-common-5.0.0-7.el6.x86_64 bacula-director-sqlite-5.0.0-7.el6.x86_64 bacula-storage-common-5.0.0-7.el6.x86_64 bacula-console-5.0.0-7.el6.x86_64 bacula-storage-sqlite-5.0.0-7.el6.x86_64 How reproducible: Everytime, see below: Steps to Reproduce: 1. yum install bacula-common bacula-director-common 2. grep /var/spool/bacula/log /etc/bacula/bacula-dir.conf RESULT: append = "/var/spool/bacula/log" = all, !skipped EXPECTED: append = "/var/log/bacula.log" = all, !skipped 3. grep /var/spool/bacula/log /etc/logwatch/conf/logfiles/bacula.conf RESULT: LogFile = /var/spool/bacula/log EXPECTED: LogFile = bacula.log 4. grep /var/spool/bacula/log /etc/logrotate.d/bacula RESULT: /var/log/bacula/*.log /var/spool/bacula/log /var/log/bacula.log { EXPECTED: /var/log/bacula/*.log /var/log/bacula.log { Actual results: Bacula uses /var/spool/bacula/log rather /var/log/bacula.log by default as log file. Expected results: Bacula should use /var/log/bacula.log by default as log file. Additional info: Violating FHS causes SELinux avc denied errors, because neither logwatch nor logrotate are allowed by default via selinux-policy to handle (read, write, follow) elements labeled with var_spool_t.