From ed9c5cf62614e9e0fd156fce38ed982d82b2616f Mon Sep 17 00:00:00 2001 From: Xing Zhou Date: Thu, 15 Dec 2016 15:18:42 +0800 Subject: [PATCH] Add customization for wsgi process display name when ceilometer api is deployed in httpd, however the process name is like '/usr/sbin/httpd -DFOREGROUND', it is ambiguous and make monitoring more difficult. the aodh, gnocchi module are also like that. so we should set an appropriate name for wsgi process. Change-Id: I5e8c9be062a88e9ed6442e6cbce6573fba385030 Related-Bug: #1626550 --- manifests/wsgi/apache.pp | 70 ++++++++++--------- spec/defines/openstacklib_wsgi_apache_spec.rb | 18 ++--- 2 files changed, 48 insertions(+), 40 deletions(-) diff --git a/manifests/wsgi/apache.pp b/manifests/wsgi/apache.pp index 15a7061d..bceb0a99 100644 --- a/manifests/wsgi/apache.pp +++ b/manifests/wsgi/apache.pp @@ -99,6 +99,10 @@ # (optional) Name of the WSGI daemon process. # Defaults to $name # +# [*wsgi_process_display_name*] +# (optional) Name of the WSGI process display-name. +# Defaults to $name +# # [*wsgi_process_group*] # (optional) Name of the WSGI process group. # Defaults to $name @@ -143,34 +147,35 @@ # Defaults to undef. # define openstacklib::wsgi::apache ( - $service_name = $name, - $bind_host = undef, - $bind_port = undef, - $group = undef, - $path = '/', - $priority = '10', - $servername = $::fqdn, - $ssl = false, - $ssl_ca = undef, - $ssl_cert = undef, - $ssl_certs_dir = undef, - $ssl_chain = undef, - $ssl_crl = undef, - $ssl_crl_path = undef, - $ssl_key = undef, - $threads = $::os_workers, - $user = undef, - $workers = 1, - $wsgi_daemon_process = $name, - $wsgi_process_group = $name, - $wsgi_script_dir = undef, - $wsgi_script_file = undef, - $wsgi_script_source = undef, - $wsgi_application_group = '%{GLOBAL}', - $wsgi_pass_authorization = undef, - $wsgi_chunked_request = undef, - $vhost_custom_fragment = undef, - $allow_encoded_slashes = undef, + $service_name = $name, + $bind_host = undef, + $bind_port = undef, + $group = undef, + $path = '/', + $priority = '10', + $servername = $::fqdn, + $ssl = false, + $ssl_ca = undef, + $ssl_cert = undef, + $ssl_certs_dir = undef, + $ssl_chain = undef, + $ssl_crl = undef, + $ssl_crl_path = undef, + $ssl_key = undef, + $threads = $::os_workers, + $user = undef, + $workers = 1, + $wsgi_daemon_process = $name, + $wsgi_process_display_name = $name, + $wsgi_process_group = $name, + $wsgi_script_dir = undef, + $wsgi_script_file = undef, + $wsgi_script_source = undef, + $wsgi_application_group = '%{GLOBAL}', + $wsgi_pass_authorization = undef, + $wsgi_chunked_request = undef, + $vhost_custom_fragment = undef, + $allow_encoded_slashes = undef, ) { include ::apache @@ -202,10 +207,11 @@ define openstacklib::wsgi::apache ( } $wsgi_daemon_process_options = { - user => $user, - group => $group, - processes => $workers, - threads => $threads, + user => $user, + group => $group, + processes => $workers, + threads => $threads, + display-name => $wsgi_process_display_name, } $wsgi_script_aliases = hash([$path_real,"${wsgi_script_dir}/${wsgi_script_file}"]) diff --git a/spec/defines/openstacklib_wsgi_apache_spec.rb b/spec/defines/openstacklib_wsgi_apache_spec.rb index 58b583de..77cef4ca 100644 --- a/spec/defines/openstacklib_wsgi_apache_spec.rb +++ b/spec/defines/openstacklib_wsgi_apache_spec.rb @@ -76,10 +76,11 @@ describe 'openstacklib::wsgi::apache' do 'wsgi_process_group' => 'keystone_wsgi', 'wsgi_script_aliases' => { '/' => "/var/www/cgi-bin/keystone/main" }, 'wsgi_daemon_process_options' => { - 'user' => 'keystone', - 'group' => 'keystone', - 'processes' => 1, - 'threads' => global_facts[:os_workers], + 'user' => 'keystone', + 'group' => 'keystone', + 'processes' => 1, + 'threads' => global_facts[:os_workers], + 'display-name' => 'keystone_wsgi', }, 'wsgi_application_group' => '%{GLOBAL}', 'require' => 'File[keystone_wsgi]', @@ -115,10 +116,11 @@ describe 'openstacklib::wsgi::apache' do 'ssl' => 'false', 'wsgi_daemon_process' => 'keystone_wsgi', 'wsgi_daemon_process_options' => { - 'user' => 'keystone', - 'group' => 'keystone', - 'processes' => '37', - 'threads' => '8', + 'user' => 'keystone', + 'group' => 'keystone', + 'processes' => '37', + 'threads' => '8', + 'display-name' => 'keystone_wsgi', }, 'wsgi_process_group' => 'keystone_wsgi', 'wsgi_script_aliases' => { '/' => "/var/www/cgi-bin/keystone/main" },