From 20ee322500a06ab915634c333fa2ef0627aebf0d Mon Sep 17 00:00:00 2001 From: James Gu Date: Mon, 30 Apr 2018 15:42:22 -0700 Subject: [PATCH] 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 --- monasca_setup/detection/plugins/apache.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/monasca_setup/detection/plugins/apache.py b/monasca_setup/detection/plugins/apache.py index 8a2d26a2..9992b34b 100644 --- a/monasca_setup/detection/plugins/apache.py +++ b/monasca_setup/detection/plugins/apache.py @@ -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"])