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.
Bug 1380020 - apache plugin should collect all config files
Summary: apache plugin should collect all config files
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Foreman Debug
Version: 6.2.2
Hardware: All
OS: Linux
medium
medium
Target Milestone: Unspecified
Assignee: Lukas Zapletal
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: GSS_Sat6Beta_Tracker, GSS_Sat6_Tracker
TreeView+ depends on / blocked
 
Reported: 2016-09-28 13:19 UTC by Julio Entrena Perez
Modified: 2019-08-12 14:53 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-09-29 21:39:48 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Julio Entrena Perez 2016-09-28 13:19:59 UTC
Description of problem:
Apache plugin should collect all config files for httpd.
The following config files are currently collected:

     35         self.add_copy_spec([
     36             "/etc/httpd/conf/httpd.conf",
     37             "/etc/httpd/conf.d/*.conf",
     38             "/etc/httpd/conf.modules.d/*.conf"
     39         ])

In case there are further subdirectories in /etc/httpd/conf.d/ which also contain config files, those are not collected.
For example, in a Satellite 6 server:

  # pwd
  /etc/httpd/conf.d
  
  # ls -gG
  total 52
  -rw-r--r--. 1 1240 Aug  9 17:51 03-crane.conf
  -rw-r--r--. 1 2285 Aug  9 17:52 05-foreman.conf
  drwxr-xr-x. 2   25 Aug  9 17:54 05-foreman.d          <--
  -rw-r--r--. 1 2741 Aug  9 17:52 05-foreman-ssl.conf
  drwxr-xr-x. 2   25 Aug  9 17:54 05-foreman-ssl.d      <--
  -rw-r--r--. 1  697 Aug  9 17:51 15-default.conf
  -rw-r--r--. 1 1894 Aug  9 17:52 25-puppet.conf
  -rw-r--r--. 1  747 May 22 21:48 passenger.conf
  -rw-r--r--. 1 1238 Aug  9 17:52 pulp.conf
  -rw-r--r--. 1  747 Aug  9 17:52 pulp_content.conf
  -rw-r--r--. 1  645 Jul 12 16:01 pulp_docker.conf
  -rw-r--r--. 1 1802 Jul 12 15:52 pulp_puppet.conf
  -rw-r--r--. 1 1855 Aug  9 17:52 pulp_rpm.conf
  -rw-r--r--. 1 2451 Aug  9 17:52 pulp_streamer.conf

  # ls -gG 05-foreman.d 05-foreman-ssl.d
  05-foreman.d:
  total 4
  -rw-r--r--. 1 376 Aug  9 17:54 katello.conf
  
  05-foreman-ssl.d:
  total 4
  -rw-r--r--. 1 1114 Aug  9 17:54 katello.conf

But apache plugin currently misses those:

  # ls -gG /var/tmp/sosreport-jentrena.00000000-20160928134518/etc/httpd/conf.d/
  total 52
  -rw-r--r--. 1 1240 Aug  9 17:51 03-crane.conf
  -rw-r--r--. 1 2285 Aug  9 17:52 05-foreman.conf
  -rw-r--r--. 1 2741 Aug  9 17:52 05-foreman-ssl.conf
  -rw-r--r--. 1  697 Aug  9 17:51 15-default.conf
  -rw-r--r--. 1 1894 Aug  9 17:52 25-puppet.conf
  -rw-r--r--. 1  747 May 22 21:48 passenger.conf
  -rw-r--r--. 1 1238 Aug  9 17:52 pulp.conf
  -rw-r--r--. 1  747 Aug  9 17:52 pulp_content.conf
  -rw-r--r--. 1  645 Jul 12 16:01 pulp_docker.conf
  -rw-r--r--. 1 1802 Jul 12 15:52 pulp_puppet.conf
  -rw-r--r--. 1 1855 Aug  9 17:52 pulp_rpm.conf
  -rw-r--r--. 1 2451 Aug  9 17:52 pulp_streamer.conf

Either parsing config files for Include / IncludeOptional statements or (easier) just include any *.d directory present in /etc/httpd/conf.d .

Version-Release number of selected component (if applicable):
sos-3.2-35.el7_2.3

How reproducible:
Always

Steps to Reproduce:
1. Create example.d subdirectory in directory /etc/httpd/conf.d
2. Run sosreport
3. Extract the tarball

Actual results:
Subdirectories in directory /etc/httpd/conf.d (and the config files that those subdirectories contain) are not collected.

Expected results:
Subdirectories in directory /etc/httpd/conf.d which a name ending in "*.d" (and the config files that those subdirectories contain) are collected.

Additional info:

Comment 1 Bryn M. Reeves 2016-09-28 13:40:26 UTC
This belongs to crane:
  -rw-r--r--. 1 1240 Aug  9 17:51 03-crane.conf


These belong to foreman:
  -rw-r--r--. 1 2285 Aug  9 17:52 05-foreman.conf
  drwxr-xr-x. 2   25 Aug  9 17:54 05-foreman.d          <--
  -rw-r--r--. 1 2741 Aug  9 17:52 05-foreman-ssl.conf
  drwxr-xr-x. 2   25 Aug  9 17:54 05-foreman-ssl.d      <--

No idea where this came from, but not an httpd RPM afaik:
  -rw-r--r--. 1  697 Aug  9 17:51 15-default.conf

Puppet:
  -rw-r--r--. 1 1894 Aug  9 17:52 25-puppet.conf

Passenger(?):
  -rw-r--r--. 1  747 May 22 21:48 passenger.conf

Pulp, pulp, pulp, pulp, pulp:
  -rw-r--r--. 1 1238 Aug  9 17:52 pulp.conf
  -rw-r--r--. 1  747 Aug  9 17:52 pulp_content.conf
  -rw-r--r--. 1  645 Jul 12 16:01 pulp_docker.conf
  -rw-r--r--. 1 1802 Jul 12 15:52 pulp_puppet.conf
  -rw-r--r--. 1 1855 Aug  9 17:52 pulp_rpm.conf
  -rw-r--r--. 1 2451 Aug  9 17:52 pulp_streamer.conf

The purpose of httpd.conf.d is to allow additional packages to simply drop a configuration file into the Apache set up (without modifying any existing file).

These packages are taking advantage of this feature, and the relevant plugins for those packages are where collection of these files belong.

We cannot collect everything in this path since files here can contain arbitrary secrets that we cannot cleanly elide.

> Either parsing config files for Include / IncludeOptional statements or 
> (easier) just include any *.d directory present in /etc/httpd/conf.d .

> Subdirectories in directory /etc/httpd/conf.d which a name ending in "*.d" 
> (and the config files that those subdirectories contain) are collected.

Nack: all the mentioned files belong to some identifiable component, most of which we already have plugins to support, and should be handled by enhancing or creating those plugins rather than making the Apache into a monster.

Comment 2 Julio Entrena Perez 2016-09-28 14:43:47 UTC
Since apache plugin of sosreport does not seem to be the correct place to collect /etc/httpd/conf.d/*.d/*.conf files (see above), could you please ensure that these files are collected by foreman-debug?

If that's not possible, could you please liaise with sos and make sure that GSS has a way of getting these files in sosreports?

Comment 4 Bryan Kearney 2016-09-29 21:39:48 UTC
This is already present in satellite 6.2. Based on 

http://projects.theforeman.org/issues/11149

Foreman collects the following files:

/etc/{httpd,apache2}/conf/*
/etc/{httpd,apache2}/conf.d/*
 /etc/{httpd,apache2}/conf.d/*/*


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