Browse Source

Close fd 3 and 4 (otherwise bats hangs)

release2.46
Tim Kimber 4 years ago
parent
commit
9d0b19d5d2
No known key found for this signature in database GPG Key ID: 3E1804964E76BD18
3 changed files with 10 additions and 10 deletions
  1. +2
    -2
      test/restart-ftpd
  2. +3
    -3
      test/restart-nginx
  3. +5
    -5
      test/test_helper.bash

+ 2
- 2
test/restart-ftpd View File

@ -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

+ 3
- 3
test/restart-nginx View File

@ -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

+ 5
- 5
test/test_helper.bash View File

@ -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


Loading…
Cancel
Save