From 2c208ec943a8fc45f912731076009c99bf19503a Mon Sep 17 00:00:00 2001 From: William Wernert Date: Thu, 3 Dec 2020 10:31:45 -0500 Subject: [PATCH] [fix] kill -> stop, add indent to service check, revert incorrect logic --- setup/so-functions | 8 ++++---- setup/so-setup | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/setup/so-functions b/setup/so-functions index 76e579765..767ca6288 100755 --- a/setup/so-functions +++ b/setup/so-functions @@ -259,10 +259,10 @@ check_service_status() { systemctl status $service_name > /dev/null 2>&1 local status=$? if [ $status -gt 0 ]; then - echo "$service_name is not running" >> "$setup_log" 2>&1 + echo " $service_name is not running" >> "$setup_log" 2>&1 return 1; else - echo "$service_name is running" >> "$setup_log" 2>&1 + echo " $service_name is running" >> "$setup_log" 2>&1 return 0; fi @@ -1400,11 +1400,11 @@ reinstall_init() { # Kill any salt processes (safely) for service in "${salt_services[@]}"; do # Stop the service in the background so we can exit after a certain amount of time - systemctl kill "$service" & + systemctl stop "$service" & local pid=$! local count=0 - while ! (check_service_status "$service"); do + while check_service_status "$service"; do if [[ $count -gt $service_retry_count ]]; then echo "Could not stop $service after 1 minute, exiting setup." diff --git a/setup/so-setup b/setup/so-setup index 924bdf307..3bec2bb87 100755 --- a/setup/so-setup +++ b/setup/so-setup @@ -499,11 +499,11 @@ catch() { export percentage=0 set_path - if [[ $is_manager && $is_airgap ]]; then - info "Creating airgap repo" - create_repo >> $setup_log 2>&1 + if [[ $is_manager && $is_airgap ]]; then + info "Creating airgap repo" + create_repo >> $setup_log 2>&1 airgap_rules >> $setup_log 2>&1 - fi + fi if [[ $is_minion ]]; then set_progress_str 1 'Configuring firewall'