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 1283681 - add DUMP_MODULES output from httpd
Summary: add DUMP_MODULES output from httpd
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: sos
Version: 7.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Pavel Moravec
QA Contact: BaseOS QE - Apps
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-11-19 15:00 UTC by Robert Bost
Modified: 2016-11-11 08:14 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1283682 (view as bug list)
Environment:
Last Closed: 2016-11-11 08:14:42 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Robert Bost 2015-11-19 15:00:23 UTC
Description of problem: Knowing the modules that will be loaded by httpd is a fundamental part of understanding an httpd configuration. 

Expected results:

Have a new "httpd" subdirectory in sosreport's sos_commands (<sosreport>/sos_commands/httpd) and in that directory have DUMP_MODULES output. Here is the command that should be used:

# apachectl -t -D DUMP_MODULES
 OR
# apachectl -M

Comment 2 Pavel Moravec 2015-11-20 10:54:18 UTC
(bouncing rhel7.*.0? flag since 7.2 is out)

Apache httpd  plugin is named apache, see /usr/lib/python2.7/site-packages/sos/plugins/apache.py file on RHEL7.

Per my understanding, apachectl is command working on Ubuntu, while on RHEL/Fedora/CentOS, httpd command should be used instead.

So I suggest a patch like:

--- /usr/lib/python2.7/site-packages/sos/plugins/apache.py.orig	2015-11-20 11:48:52.938198696 +0100
+++ /usr/lib/python2.7/site-packages/sos/plugins/apache.py.new	2015-11-20 11:50:36.707243208 +0100
@@ -48,6 +48,9 @@ class RedHatApache(Apache, RedHatPlugin)
         if self.get_option("log"):
             self.add_copy_spec("/var/log/httpd/*")
 
+        # collect list of installed modules
+        self.add_cmd_output(["httpd -M"])
+
 
 class DebianApache(Apache, DebianPlugin, UbuntuPlugin):
     files = ('/etc/apache2/apache2.conf',)
@@ -65,4 +68,7 @@ class DebianApache(Apache, DebianPlugin,
         if self.get_option("log"):
             self.add_copy_spec("/var/log/apache2/*")
 
+        # collect list of installed modules
+        self.add_cmd_output(["apachectl -M"])
+
 # vim: et ts=4 sw=4

(the debian bits due to compatibility with upstream, wont be executed on RHEL)

With that change, sos_commands/apache/httpd_-M file is generated.

Is that ok?

Comment 3 Bryn M. Reeves 2015-11-20 11:20:49 UTC
> Per my understanding, apachectl is command working on Ubuntu, while on 
> RHEL/Fedora/CentOS, httpd command should be used instead.

Err, both work fine here...

# rpm -q httpd
httpd-2.2.15-30.el6_5.x86_64

# apachectl -M | head -3
Syntax OK
Loaded Modules:
 core_module (static)
 mpm_prefork_module (static)

# rpm -q httpd
httpd-2.4.6-31.el7.x86_64

# apachectl -M | head -3
Loaded Modules:
 core_module (static)
 so_module (static)

The apachectl command is just a front-end to httpd that wraps additional administrative functionality in a simple-to-use interface:

  http://httpd.apache.org/docs/2.0/programs/apachectl.html

Both should be available on all distributions shipping a "normal" Apache httpd package.

We definitely don't want to have identical information in different output paths where we can at all avoid it.

Comment 4 Pavel Moravec 2015-11-20 12:58:44 UTC
Mine outputs are different (typical Satellite6 installation including httpd):

[root@pmoravec-sat61-rhel7 ~]# rpm -q httpd
httpd-2.4.6-31.el7_1.1.x86_64
[root@pmoravec-sat61-rhel7 ~]# apachectl -t -D DUMP_MODULES
Passing arguments to httpd using apachectl is no longer supported.
You can only start/stop/restart httpd using this script.
If you want to pass extra arguments to httpd, edit the
/etc/sysconfig/httpd config file.
[root@pmoravec-sat61-rhel7 ~]# apachectl -M
[root@pmoravec-sat61-rhel7 ~]# httpd -M | head -n3
Loaded Modules:
 core_module (static)
 so_module (static)
[root@pmoravec-sat61-rhel7 ~]#

That's why I raised the concern about httpd instead of apachectl command.

Comment 6 Pavel Moravec 2015-11-20 13:22:59 UTC
OK, mine failures of apachectl were most probably due to a tty issue - filed PR https://github.com/sosreport/sos/pull/692 for this request.

Comment 7 Pavel Moravec 2016-01-18 11:31:36 UTC
Fixed in upstream: 43dd41e4f0872e3a9258cd0a0a9d13e3b76a3e1c

Comment 8 Mike McCune 2016-03-28 23:20:28 UTC
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions

Comment 9 Pavel Moravec 2016-11-11 08:14:42 UTC
This has been fixed in upstream sos 3.3 we rebased to by [1] in RHEL7.3. Errata [2] should resolve this bug.

Please test [2] and in case it does not address the reported problem properly, reopen this BZ.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1293044
[2] https://rhn.redhat.com/errata/RHBA-2016-2380.html


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