Correctly detects apache process when mod_perl is installed

Apache mod_perl sets the process name to the full command path
which is truncated to 15 characters by Linux convention. Adds
/usr/sbin/httpd to the apache process known names to the apache
detection plugin.

Change-Id: I6d45e9e6d5aef46d3a230911e7778d6ab7ca9265
story: 2001945
task: 15063
This commit is contained in:
James Gu 2018-04-30 15:42:22 -07:00
parent 560462d229
commit 20ee322500
1 changed files with 8 additions and 2 deletions

View File

@ -1,4 +1,6 @@
# (C) Copyright 2015,2016 Hewlett Packard Enterprise Development Company LP
# (C) Copyright 2018 SUSE LLC
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
@ -21,8 +23,12 @@ import monasca_setup.detection
log = logging.getLogger(__name__)
# Process name is apache2 on Debian derivatives, on RHEL derivatives it's httpd,
# on openSUSE/SLES it might be httpd-prefork or httpd-worker
APACHE_PROCESS_NAMES = ('apache2', 'httpd', 'httpd-prefork', 'httpd-worker')
# on openSUSE/SLES it might be httpd-prefork or httpd-worker. With some versions
# of apache2-mod_perl, e.g., 2.0.8, the process name is "/usr/sbin/httpd" after
# being truncated to the UNIX limit of 15 characters. "/usr/sbin/httpd" should
# be removed from the list when we conclude the offending verson(s) of the
# mod_perl is no longer in use.
APACHE_PROCESS_NAMES = ('apache2', 'httpd', 'httpd-prefork', 'httpd-worker', '/usr/sbin/httpd')
DEFAULT_APACHE_CONFIG = '/root/.apache.cnf'
CONFIG_ARG_KEYS = set(["url", "user", "password", "use_server_status_metrics"])