Ema has submitted this change and it was merged. Change subject: Remove unused varnishncsa-related code ......................................................................
Remove unused varnishncsa-related code The last usage of varnish::logging (and varnishncsa in general) has been removed in https://gerrit.wikimedia.org/r/#/c/259051/. Get rid of all varnishncsa-related puppet code. Change-Id: Iebe6a707bf133169e7a8a1e62746ad7f4731d16a --- M modules/nagios_common/files/checkcommands.cfg M modules/nrpe/templates/nrpe_local.cfg.erb D modules/varnish/files/varnishncsa.default D modules/varnish/manifests/logging.pp D modules/varnish/manifests/logging/config.pp D modules/varnish/templates/initscripts/varnishncsa.sysvinit.erb M modules/varnish/templates/vcl/wikimedia-frontend.vcl.erb 7 files changed, 3 insertions(+), 202 deletions(-) Approvals: Ema: Verified; Looks good to me, approved BBlack: Looks good to me, but someone else must approve diff --git a/modules/nagios_common/files/checkcommands.cfg b/modules/nagios_common/files/checkcommands.cfg index 8c014fa..fabbcc0 100644 --- a/modules/nagios_common/files/checkcommands.cfg +++ b/modules/nagios_common/files/checkcommands.cfg @@ -344,10 +344,6 @@ command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_udp2log_procs } define command { - command_name nrpe_check_varnishncsa - command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_varnishncsa -} -define command { command_name check_eventlogging_jobs command_line $USER1$/check_eventlogging_jobs } diff --git a/modules/nrpe/templates/nrpe_local.cfg.erb b/modules/nrpe/templates/nrpe_local.cfg.erb index 68b3137..e99e4c9 100644 --- a/modules/nrpe/templates/nrpe_local.cfg.erb +++ b/modules/nrpe/templates/nrpe_local.cfg.erb @@ -10,11 +10,3 @@ <% end -%> command[check_ram]=/usr/lib/nagios/plugins/check_ram.sh 20 5 b - -# process checks, we can't make this generic because we don't pass args via nrpe (security) -<%# text caches run an extra varnishncsa for statsv eventlogging -%> -<% if @cluster == "cache_text" -%> -command[check_varnishncsa]=/usr/lib/nagios/plugins/check_procs -w 3:3 -c 3:6 -C varnishncsa -<% else -%> -command[check_varnishncsa]=/usr/lib/nagios/plugins/check_procs -w 2:2 -c 2:6 -C varnishncsa -<% end -%> diff --git a/modules/varnish/files/varnishncsa.default b/modules/varnish/files/varnishncsa.default deleted file mode 100644 index c119080..0000000 --- a/modules/varnish/files/varnishncsa.default +++ /dev/null @@ -1,9 +0,0 @@ -## THIS FILE MANAGED BY PUPPET ## -VARNISHNCSA_ENABLED=1 - -# set LOG_FORMAT so that varnishncsa logs -# the Content-Type. This is the same as -# the Wikimedia default log format, except -# for the addition of the Content-Type -# response header. See T80476. -LOG_FORMAT="%l %n %t %{Varnish:time_firstbyte}x %h %{Varnish:handling}x/%s %b %m http://%{Host}i%U%q - %{Content-Type}o %{Referer}i %{X-Forwarded-For}i %{User-agent}i %{Accept-Language}i %{X-Analytics}o" diff --git a/modules/varnish/manifests/logging.pp b/modules/varnish/manifests/logging.pp deleted file mode 100644 index 93a9dc6..0000000 --- a/modules/varnish/manifests/logging.pp +++ /dev/null @@ -1,39 +0,0 @@ -define varnish::logging( - $listener_address, - $port='8420', - $cli_args='', - $log_fmt=false, - $instance_name='frontend', - $monitor=true, - $ensure='present', -) { - require varnish::packages - require varnish::logging::config - - $varnishservice = $instance_name ? { - '' => 'varnish', - default => "varnish-${instance_name}" - } - - $shm_name = $instance_name ? { - '' => $::hostname, - default => $instance_name - } - - base::service_unit { "varnishncsa-${name}": - ensure => $ensure, - template_name => 'varnishncsa', - sysvinit => true, - } - - Service[$varnishservice] -> Service["varnishncsa-${name}"] - File['/etc/default/varnishncsa'] ~> Service["varnishncsa-${name}"] - - if $monitor { - nrpe::monitor_service { "varnishncsa-${name}": - ensure => $ensure, - description => "Varnish traffic logger - ${name}", - nrpe_command => "/usr/lib/nagios/plugins/check_procs -c 1:1 -a varnishncsa-${name}.pid -u varnishlog", - } - } -} diff --git a/modules/varnish/manifests/logging/config.pp b/modules/varnish/manifests/logging/config.pp deleted file mode 100644 index da8dba6..0000000 --- a/modules/varnish/manifests/logging/config.pp +++ /dev/null @@ -1,8 +0,0 @@ -class varnish::logging::config { - file { '/etc/default/varnishncsa': - source => "puppet:///modules/${module_name}/varnishncsa.default", - owner => 'root', - group => 'root', - mode => '0444', - } -} diff --git a/modules/varnish/templates/initscripts/varnishncsa.sysvinit.erb b/modules/varnish/templates/initscripts/varnishncsa.sysvinit.erb deleted file mode 100755 index c537222..0000000 --- a/modules/varnish/templates/initscripts/varnishncsa.sysvinit.erb +++ /dev/null @@ -1,131 +0,0 @@ -#! /bin/sh - -### BEGIN INIT INFO -# Provides: varnishncsa -# Required-Start: $local_fs $remote_fs $network -# Required-Stop: $local_fs $remote_fs $network -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Start HTTP accelerator log daemon -# Description: This script provides logging for varnish -### END INIT INFO - -# Source function library -. /lib/lsb/init-functions - -NAME=<%= @name %> -DESC="HTTP accelerator log deamon" -PATH=/sbin:/bin:/usr/sbin:/usr/bin -DAEMON=/usr/bin/varnishncsa -PIDFILE=/var/run/varnishncsa/$NAME.pid -LOGFILE=/var/log/varnish/varnishncsa.log -USER=varnishlog - -DAEMON_OPTS="-n <%= @shm_name %> -w <%= @listener_address %>:<%= @port %> <%= @cli_args %> -P $PIDFILE" - -# Include defaults if available -if [ -f /etc/default/varnishncsa ] ; then - . /etc/default/varnishncsa -fi - -<% if @log_fmt != false then %> -LOG_FORMAT="<%= @log_fmt %>" -<% end %> - -# If unset, or set to "0" or "no", exit -if [ -z "${VARNISHNCSA_ENABLED}" ] || \ - [ "${VARNISHNCSA_ENABLED}" = "0" ] || \ - [ "${VARNISHNCSA_ENABLED}" = "no" ]; then - exit 0; -fi - -test -x $DAEMON || exit 0 - - -# I can't seem to make quoting work properly with -# $LOG_FORMAT set from /etc/default/varnishncsa. -# I have to manually quote the LOG_FORMAT string -# in the start-stop-daemon line here. NOT ideal -# at all. This means I have to ALWAYS pass the -F -# option with a hardcoded default LOG_FORMAT. -# The default is already hardcoded into -# Wikimedia's package of varnishncsa, so yuck. -# I don't like it. - -# if LOG_FORMAT is not set in /etc/default/varnishncsa, -# Then use this as a default. This is the default -# currently (2012-05) compiled into Wikimedia's -# version of varnishncsa. -DEFAULT_LOG_FORMAT='%l %n %t %{Varnish:time_firstbyte}x %h %{Varnish:handling}x/%s %b %m http://%{Host}i%U%q - - %{Referer}i %{X-Forwarded-For}i %{User-agent}i' -LOG_FORMAT=${LOG_FORMAT:-${DEFAULT_LOG_FORMAT}} - -start_varnishncsa() { - output=$(/bin/tempfile -s.varnish) - log_daemon_msg "Starting $DESC" "$NAME" - create_pid_directory - - if start-stop-daemon --start --quiet --pidfile ${PIDFILE} \ - --chuid $USER --exec ${DAEMON} -- ${DAEMON_OPTS} -F "${LOG_FORMAT}" \ - > ${output} 2>&1; then - log_end_msg 0 - else - log_end_msg 1 - cat $output - exit 1 - fi - rm $output -} - -stop_varnishncsa(){ - log_daemon_msg "Stopping $DESC" "$NAME" - if start-stop-daemon --stop --quiet --pidfile $PIDFILE \ - --retry 10 --exec $DAEMON; then - log_end_msg 0 - else - log_end_msg 1 - fi -} - -reload_varnishncsa(){ - log_daemon_msg "Reloading $DESC" "$NAME" - if kill -HUP $(cat $PIDFILE) >/dev/null 2>&1; then - log_end_msg 0 - else - log_end_msg 1 - exit 1 - fi -} - -status_varnishncsa(){ - status_of_proc -p "${PIDFILE}" "${DAEMON}" "${NAME}" -} - -create_pid_directory() { - install -o $USER -g $USER -d $(dirname $PIDFILE) -} - -case "$1" in - start) - start_varnishncsa - ;; - stop) - stop_varnishncsa - ;; - reload) - reload_varnishncsa - ;; - status) - status_varnishncsa - exit $? - ;; - restart|force-reload) - $0 stop - $0 start - ;; - *) - log_success_msg "Usage: $0 {start|stop|restart|force-reload|reload}" - exit 1 - ;; -esac - -exit 0 diff --git a/modules/varnish/templates/vcl/wikimedia-frontend.vcl.erb b/modules/varnish/templates/vcl/wikimedia-frontend.vcl.erb index 85b2039..356d837 100644 --- a/modules/varnish/templates/vcl/wikimedia-frontend.vcl.erb +++ b/modules/varnish/templates/vcl/wikimedia-frontend.vcl.erb @@ -258,9 +258,9 @@ if (req.url ~ "^/beacon\/[^/?]+") { // Logging beacon endpoints // - // They are handled by log tailers (varnishkafka and varnishncsa) that filter the - // Varnish shm log for reqs to these endpoints and forward them to log processors - // for storage and analysis. + // They are handled by the log tailer (varnishkafka) that filters the + // Varnish shm log for reqs to these endpoints and forwards them to log + // processors for storage and analysis. <%= error_synth(204, "") -%> } -- To view, visit https://gerrit.wikimedia.org/r/291226 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iebe6a707bf133169e7a8a1e62746ad7f4731d16a Gerrit-PatchSet: 2 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Ema <e...@wikimedia.org> Gerrit-Reviewer: BBlack <bbl...@wikimedia.org> Gerrit-Reviewer: Ema <e...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits