ADMIN: reload: introduce -vv mode

The -v verbose mode displays the loading messages returned by the master
CLI reload command upon error.

The new -vv mode displays the loading messages even upon success,
showing the content of `show startup-logs` after the reload attempt.
This commit is contained in:
William Lallemand 2025-09-29 19:21:08 +02:00
parent 5d05f343b9
commit 6316f958e3

View File

@ -28,6 +28,8 @@ reload() {
else else
if [ "$RET" = 1 ] && [ "$VERBOSE" = "2" ]; then if [ "$RET" = 1 ] && [ "$VERBOSE" = "2" ]; then
echo "$line" >&2 echo "$line" >&2
elif [ "$VERBOSE" = "3" ]; then
echo "$line" >&2
fi fi
fi fi
@ -50,12 +52,13 @@ usage() {
echo " EXPERIMENTAL script!" echo " EXPERIMENTAL script!"
echo "" echo ""
echo "Options:" echo "Options:"
echo " -S, --master-socket <path> Use the master socket at <path> (default: ${MASTER_SOCKET})" echo " -S, --master-socket <path> Use the master socket at <path> (default: ${MASTER_SOCKET})"
echo " -d, --debug Debug mode, set -x" echo " -d, --debug Debug mode, set -x"
echo " -t, --timeout Timeout (socat -t) (default: ${TIMEOUT})" echo " -t, --timeout Timeout (socat -t) (default: ${TIMEOUT})"
echo " -s, --silent Slient mode (no output)" echo " -s, --silent Slient mode (no output)"
echo " -v, --verbose Verbose mode (output from haproxy)" echo " -v, --verbose Verbose output (output from haproxy on failure)"
echo " -h, --help This help" echo " -vv Even more verbose output (output from haproxy on success and failure)"
echo " -h, --help This help"
echo "" echo ""
echo "Examples:" echo "Examples:"
echo " $0 -S ${MASTER_SOCKET} -d ${TIMEOUT}" echo " $0 -S ${MASTER_SOCKET} -d ${TIMEOUT}"
@ -81,6 +84,10 @@ main() {
VERBOSE=2 VERBOSE=2
shift shift
;; ;;
-vv|--verbose)
VERBOSE=3
shift
;;
-d|--debug) -d|--debug)
DEBUG=1 DEBUG=1
shift shift