mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
logic change
This commit is contained in:
@@ -1379,14 +1379,12 @@ check_service_status() {
|
|||||||
#true if there is an issue with the service false if it is running properly
|
#true if there is an issue with the service false if it is running properly
|
||||||
if [ $status -gt 0 ]; then
|
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
|
||||||
status=1
|
echo 1;
|
||||||
else
|
else
|
||||||
echo "$service_name is running" >> "$setup_log" 2>&1
|
echo "$service_name is running" >> "$setup_log" 2>&1
|
||||||
status=0
|
echo 0;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
return $status
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
check_salt_master_status() {
|
check_salt_master_status() {
|
||||||
@@ -1395,14 +1393,12 @@ check_salt_master_status() {
|
|||||||
local status=$?
|
local status=$?
|
||||||
#true if there is an issue talking to salt master
|
#true if there is an issue talking to salt master
|
||||||
if [ $status -gt 0 ]; then
|
if [ $status -gt 0 ]; then
|
||||||
status=1
|
echo 1;
|
||||||
else
|
else
|
||||||
echo "Can talk to salt master" >> "$setup_log" 2>&1
|
echo "Can talk to salt master" >> "$setup_log" 2>&1
|
||||||
status=0
|
echo 0;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
return $status
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
check_salt_minion_status() {
|
check_salt_minion_status() {
|
||||||
@@ -1411,14 +1407,12 @@ check_salt_minion_status() {
|
|||||||
local status=$?
|
local status=$?
|
||||||
#true if there is an issue getting a job response from the minion
|
#true if there is an issue getting a job response from the minion
|
||||||
if [ $status -gt 0 ]; then
|
if [ $status -gt 0 ]; then
|
||||||
status=1
|
echo 1;
|
||||||
else
|
else
|
||||||
echo "Received job response from salt minion" >> "$setup_log" 2>&1
|
echo "Received job response from salt minion" >> "$setup_log" 2>&1
|
||||||
status=0
|
echo 0;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
return $status
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
salt_checkin() {
|
salt_checkin() {
|
||||||
@@ -1439,7 +1433,7 @@ salt_checkin() {
|
|||||||
echo "Stopping service $service" >> "$setup_log" 2>&1
|
echo "Stopping service $service" >> "$setup_log" 2>&1
|
||||||
systemctl stop "$service" >> "$setup_log" 2>&1
|
systemctl stop "$service" >> "$setup_log" 2>&1
|
||||||
LOOP_COUNT=0
|
LOOP_COUNT=0
|
||||||
while ! check_service_status $service; do
|
while ! $(check_service_status $service); do
|
||||||
echo "$service still running" >> "$setup_log" 2>&1
|
echo "$service still running" >> "$setup_log" 2>&1
|
||||||
if [ $LOOP_COUNT -gt 60 ]; then
|
if [ $LOOP_COUNT -gt 60 ]; then
|
||||||
echo "$service could not be stopped in 60 seconds, exiting" >> "$setup_log" 2>&1
|
echo "$service could not be stopped in 60 seconds, exiting" >> "$setup_log" 2>&1
|
||||||
@@ -1456,7 +1450,7 @@ salt_checkin() {
|
|||||||
echo "Starting service $service" >> "$setup_log" 2>&1
|
echo "Starting service $service" >> "$setup_log" 2>&1
|
||||||
systemctl start "$service" >> "$setup_log" 2>&1
|
systemctl start "$service" >> "$setup_log" 2>&1
|
||||||
LOOP_COUNT=0
|
LOOP_COUNT=0
|
||||||
while check_service_status $service; do
|
while $(check_service_status $service); do
|
||||||
echo "$service still not running" >> "$setup_log" 2>&1
|
echo "$service still not running" >> "$setup_log" 2>&1
|
||||||
if [ $LOOP_COUNT -gt 60 ]; then
|
if [ $LOOP_COUNT -gt 60 ]; then
|
||||||
echo "$service could not be started in 60 seconds, exiting" >> "$setup_log" 2>&1
|
echo "$service could not be started in 60 seconds, exiting" >> "$setup_log" 2>&1
|
||||||
@@ -1470,7 +1464,7 @@ salt_checkin() {
|
|||||||
#sleep 15;
|
#sleep 15;
|
||||||
|
|
||||||
LOOP_COUNT=0
|
LOOP_COUNT=0
|
||||||
while check_salt_master_status; do
|
while $(check_salt_master_status); do
|
||||||
echo "salt minion cannot talk to salt master" >> "$setup_log" 2>&1
|
echo "salt minion cannot talk to salt master" >> "$setup_log" 2>&1
|
||||||
if [ $LOOP_COUNT -gt 30 ]; then
|
if [ $LOOP_COUNT -gt 30 ]; then
|
||||||
echo "salt minion could not talk to salt master after 30 attempts, exiting" >> "$setup_log" 2>&1
|
echo "salt minion could not talk to salt master after 30 attempts, exiting" >> "$setup_log" 2>&1
|
||||||
@@ -1481,7 +1475,7 @@ salt_checkin() {
|
|||||||
done
|
done
|
||||||
|
|
||||||
LOOP_COUNT=0
|
LOOP_COUNT=0
|
||||||
while check_salt_minion_status; do
|
while $(check_salt_minion_status); do
|
||||||
echo "salt master did not get a job response from salt minion" >> "$setup_log" 2>&1
|
echo "salt master did not get a job response from salt minion" >> "$setup_log" 2>&1
|
||||||
if [ $LOOP_COUNT -gt 30 ]; then
|
if [ $LOOP_COUNT -gt 30 ]; then
|
||||||
echo "salt master did not get a job response from salt minion after 30 attempts, exiting" >> "$setup_log" 2>&1
|
echo "salt master did not get a job response from salt minion after 30 attempts, exiting" >> "$setup_log" 2>&1
|
||||||
|
|||||||
Reference in New Issue
Block a user