From b14b9e8e1743108003db9c33fe6553ebd4f98071 Mon Sep 17 00:00:00 2001 From: William Wernert Date: Thu, 11 Mar 2021 16:34:54 -0500 Subject: [PATCH] [fix] Fix dependency install progress bar --- setup/so-functions | 10 ---------- setup/so-setup | 9 +++++++++ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/setup/so-functions b/setup/so-functions index d3747f3b5..d4d1b4f96 100755 --- a/setup/so-functions +++ b/setup/so-functions @@ -1007,9 +1007,6 @@ installer_progress_loop() { } installer_prereq_packages() { - installer_progress_loop & # Run progress bar to 100 in ~8 minutes - progress_bg_proc=$! - if [ "$OS" == centos ]; then # Print message to stdout so the user knows setup is doing something # Install bind-utils so the host command exists @@ -1044,13 +1041,6 @@ installer_prereq_packages() { fi retry 50 10 "apt-get -y install curl" >> "$setup_log" 2>&1 || exit 1 fi - - install_success=$? - kill -9 "$progress_bg_proc" >> "$setup_log" 2>&1 - if [[ $install_success -gt 0 ]]; then - echo "Could not install packages required for setup, exiting now." >> "$setup_log" 2>&1 - kill -SIGUSR1 "$setup_proc" >> "$setup_log" 2>&1; exit 1 - fi } disable_auto_start() { diff --git a/setup/so-setup b/setup/so-setup index 46b005a5e..0f37de3d4 100755 --- a/setup/so-setup +++ b/setup/so-setup @@ -281,7 +281,16 @@ fi percentage=0 { + installer_progress_loop & # Run progress bar to 100 in ~8 minutes + progress_bg_proc=$! installer_prereq_packages + install_success=$? + kill -9 "$progress_bg_proc" + wait "$progress_bg_proc" &> /dev/null # Kill just sends signal, redirect output of wait to catch stdout + if [[ $install_success -gt 0 ]]; then + echo "Could not install packages required for setup, exiting now." >> "$setup_log" 2>&1 + kill -SIGUSR1 "$setup_proc"; exit 1 + fi set_progress_str 99 "Detecting whether setup is running in the cloud." nolog detect_cloud } | progress '...'