Bug 1283681 - add DUMP_MODULES output from httpd
add DUMP_MODULES output from httpd
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: sos (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Pavel Moravec
BaseOS QE - Apps
Depends On:
  Show dependency treegraph
Reported: 2015-11-19 10:00 EST by Robert Bost
Modified: 2016-11-11 03:14 EST (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1283682 (view as bug list)
Last Closed: 2016-11-11 03:14:42 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Robert Bost 2015-11-19 10:00:23 EST
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
# apachectl -M
Comment 2 Pavel Moravec 2015-11-20 05:54:18 EST
(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"):
+        # 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"):
+        # 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 06:20:49 EST
> 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

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

# rpm -q httpd

# 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:


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 07:58:44 EST
Mine outputs are different (typical Satellite6 installation including httpd):

[root@pmoravec-sat61-rhel7 ~]# rpm -q httpd
[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 08:22:59 EST
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 06:31:36 EST
Fixed in upstream: 43dd41e4f0872e3a9258cd0a0a9d13e3b76a3e1c
Comment 8 Mike McCune 2016-03-28 19:20:28 EDT
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune@redhat.com with any questions
Comment 9 Pavel Moravec 2016-11-11 03:14:42 EST
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.