From a4e5eddfcd484088f692fec2375e7bc9ddff1b79 Mon Sep 17 00:00:00 2001 From: Geoff Franks Date: Thu, 3 Oct 2019 18:00:11 -0400 Subject: [PATCH] Fixes #153 - add hatop utility for troubleshooting haproxy --- ci/release_notes.md | 12 ++++++++++++ config/blobs.yml | 3 +++ packages/haproxy/packaging | 5 +++++ packages/haproxy/spec | 2 ++ src/hatop-wrapper | 9 +++++++++ 5 files changed, 31 insertions(+) create mode 100644 ci/release_notes.md create mode 100644 src/hatop-wrapper diff --git a/ci/release_notes.md b/ci/release_notes.md new file mode 100644 index 00000000..6f28d612 --- /dev/null +++ b/ci/release_notes.md @@ -0,0 +1,12 @@ +# New Features + +- The `hatop` utility has been added to haproxy-boshrelease to assist in haproxy troubleshooting + http://feurix.org/projects/hatop/ Kudos to @jhunt and the [Genesis Community](https://github.com/genesis-community) for making this possible! +- @Scoobed added support for specifying additional filesystem paths to make available to the HAProxy + process via BPM's [unrestricted volumes list](https://github.com/cloudfoundry/bpm-release/blob/master/docs/config.md#unsafe-schema). + This is particularly helpful when integrating LUA scripts from other BOSH releases. The + `ha_proxy.additional_unrestricted_volumes` will allow this, and uses the same syntax as BPM. + +# Acknowledgements + +Thanks @jhunt and @Scoobed! diff --git a/config/blobs.yml b/config/blobs.yml index 26d26179..94a37771 100644 --- a/config/blobs.yml +++ b/config/blobs.yml @@ -10,6 +10,9 @@ haproxy/haproxy-1.8.20.tar.gz: size: 2083917 object_id: 4a94da26-7a25-4117-5e48-057d6a31fa03 sha: 7aa627e4ae0b2ee603d5525436c7f4d13b8e2f5e +haproxy/hatop: + size: 72429 + sha: daddb3f13a70d4e2fa0802333c2e13468635171f haproxy/lua-5.3.5.tar.gz: size: 303543 object_id: 5acd4a28-51a4-45ed-536b-766fec394fa5 diff --git a/packages/haproxy/packaging b/packages/haproxy/packaging index b52a438d..a3c78e2e 100644 --- a/packages/haproxy/packaging +++ b/packages/haproxy/packaging @@ -37,3 +37,8 @@ pushd haproxy-${HAPROXY_VERSION} cp haproxy ${BOSH_INSTALL_TARGET}/bin/ chmod 755 ${BOSH_INSTALL_TARGET}/bin/haproxy popd + +cp haproxy/hatop ${BOSH_INSTALL_TARGET}/bin/hatop +chmod 755 ${BOSH_INSTALL_TARGET}/bin/hatop +cp hatop-wrapper ${BOSH_INSTALL_TARGET}/ +chmod 755 ${BOSH_INSTALL_TARGET}/hatop-wrapper diff --git a/packages/haproxy/spec b/packages/haproxy/spec index 6a865a92..f4d60a25 100644 --- a/packages/haproxy/spec +++ b/packages/haproxy/spec @@ -5,3 +5,5 @@ files: - haproxy/pcre2-*.tar.gz - haproxy/socat-*.tar.gz - haproxy/lua-*.tar.gz +- haproxy/hatop +- hatop-wrapper diff --git a/src/hatop-wrapper b/src/hatop-wrapper new file mode 100644 index 00000000..5e1a5ccd --- /dev/null +++ b/src/hatop-wrapper @@ -0,0 +1,9 @@ +#!/bin/bash +if [[ -z "${1:-}" ]]; then + if [[ -e /var/vcap/sys/run/haproxy/stats.sock ]]; then + exec /var/vcap/packages/haproxy/bin/hatop -s /var/vcap/sys/run/haproxy/stats.sock + elif [[ -e /var/vcap/sys/run/haproxy/stats1.sock ]]; then + exec /var/vcap/packages/haproxy/bin/hatop -s /var/vcap/sys/run/haproxy/stats1.sock + fi +fi +exec /var/vcap/packages/haproxy/bin/hatop "$@"