RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 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 "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". 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 "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-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.
Bug 728697 - Bacula uses /var/spool/bacula/log rather /var/log/bacula.log by default as log file
Summary: Bacula uses /var/spool/bacula/log rather /var/log/bacula.log by default as lo...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: bacula
Version: 6.1
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Lukáš Nykrýn
QA Contact: Tomas Dolezal
URL:
Whiteboard:
Depends On:
Blocks: 782183 840699
TreeView+ depends on / blocked
 
Reported: 2011-08-06 14:25 UTC by Robert Scheck
Modified: 2018-11-29 21:48 UTC (History)
7 users (show)

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.
Clone Of:
Environment:
Last Closed: 2012-11-19 04:15:08 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 62940 0 None None None Never
Red Hat Product Errata RHBA-2012:1469 0 normal SHIPPED_LIVE bacula bug fix update 2012-11-19 09:14:28 UTC

Description Robert Scheck 2011-08-06 14:25:04 UTC
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.

Comment 1 Robert Scheck 2011-08-06 14:28:16 UTC
I have cross-filed case 00515390 for this issue in the Red Hat customer portal.

Comment 3 RHEL Program Management 2011-08-06 14:57:52 UTC
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.

Comment 4 Robert Scheck 2011-10-11 12:04:02 UTC
Filled as case 00545706 as well, because affects another customer, too.

Comment 5 Robert Scheck 2011-10-13 10:59:01 UTC
Same for case 00547366, yet another customer.

Comment 6 Lukáš Nykrýn 2011-10-17 12:33:30 UTC
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?

Comment 7 Robert Scheck 2011-10-17 12:37:32 UTC
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

Comment 8 Lukáš Nykrýn 2011-10-17 14:48:40 UTC
1. You can take messages from this log as unread mail, this file contains all mails sended to administrator.
2. Added mgrepl to CC

Comment 9 Miroslav Grepl 2011-10-18 07:48:24 UTC
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?

Comment 10 Robert Scheck 2011-10-18 08:55:28 UTC
In which version of the policy? That version that comes with RHEL 6.1 with all
standard updates?

Comment 11 Lukáš Nykrýn 2011-10-18 09:23:39 UTC
(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.

Comment 12 Miroslav Grepl 2011-10-18 09:27:34 UTC
RHEL6.2 policy which you can grab from

http://people.redhat.com/dwalsh/SELinux/RHEL6/noarch/

Comment 13 Robert Scheck 2011-10-18 09:35:50 UTC
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?

Comment 14 Lukáš Nykrýn 2011-10-27 08:53:37 UTC
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.

Comment 25 errata-xmlrpc 2012-11-19 04:15:08 UTC
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


Note You need to log in before you can comment on or make changes to this bug.