From 9d0b19d5d26cd90ff0a7fcc42e96527639876a6d Mon Sep 17 00:00:00 2001 From: Tim Kimber Date: Fri, 7 Jan 2022 16:58:47 +0000 Subject: [PATCH] Close fd 3 and 4 (otherwise bats hangs) --- test/restart-ftpd | 4 ++-- test/restart-nginx | 6 +++--- test/test_helper.bash | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/test/restart-ftpd b/test/restart-ftpd index 6bb780c..a212b78 100755 --- a/test/restart-ftpd +++ b/test/restart-ftpd @@ -7,11 +7,11 @@ else fi if [ "$GETSSL_OS" = "alpine" ]; then - killall -HUP vsftpd >&3- + killall -HUP vsftpd elif [[ "$GETSSL_OS" == "centos"[78] || "$GETSSL_OS" == "rockylinux"* ]]; then pgrep vsftpd | head -1 | xargs kill -HUP elif [[ "$GETSSL_OS" == "centos6" ]]; then service vsftpd "$arg" else - service vsftpd restart >/dev/null >&3- + service vsftpd restart >/dev/null 3>&- 4>&- fi diff --git a/test/restart-nginx b/test/restart-nginx index ee49af4..25bbca4 100755 --- a/test/restart-nginx +++ b/test/restart-nginx @@ -1,14 +1,14 @@ #!/usr/bin/env bash if [ "$GETSSL_OS" = "alpine" ]; then - killall -HUP nginx >&3- + killall -HUP nginx sleep 5 elif [[ "$GETSSL_OS" == "centos"[78] || "$GETSSL_OS" == "rockylinux"* ]]; then pgrep nginx | head -1 | xargs kill -HUP sleep 5 elif [[ "$GETSSL_OS" == "centos6" ]]; then - service nginx restart 3>&- + service nginx restart # service nginx restart else - service nginx restart >/dev/null >&3- + service nginx restart >/dev/null 3>&- 4>&- fi diff --git a/test/test_helper.bash b/test/test_helper.bash index e8d68b0..92d15ca 100644 --- a/test/test_helper.bash +++ b/test/test_helper.bash @@ -68,16 +68,16 @@ setup_environment() { # shellcheck disable=SC2153 # Ignore GETSSL_OS looks like typo of GETSSL_IP if [[ -f /usr/bin/supervisord && -f /etc/supervisord.conf ]]; then if [[ ! $(pgrep supervisord) ]]; then - /usr/bin/supervisord -c /etc/supervisord.conf >&3- - # Give supervisord time to start - sleep 1 + /usr/bin/supervisord -c /etc/supervisord.conf 3>&- 4>&- + # Give supervisord time to start + sleep 1 fi elif [[ "$GETSSL_OS" == "centos"[78] || "$GETSSL_OS" == "rockylinux"* ]]; then if [ -z "$(pgrep nginx)" ]; then - nginx 3>&- + nginx 3>&- 4>&- fi if [ -z "$(pgrep vsftpd)" ] && [ "$(command -v vsftpd)" ]; then - vsftpd 3>&- + vsftpd 3>&- 4>&- fi fi