From e56f90d83c894c4356197bcf90c4c7830616e29d Mon Sep 17 00:00:00 2001 From: Doug Burks Date: Wed, 16 Mar 2022 13:27:37 -0400 Subject: [PATCH 1/2] FIX: Prevent multiple instances of so-playbook-sync #6622 --- salt/common/tools/sbin/so-playbook-sync | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/salt/common/tools/sbin/so-playbook-sync b/salt/common/tools/sbin/so-playbook-sync index c63ee38ad..91560aa0c 100755 --- a/salt/common/tools/sbin/so-playbook-sync +++ b/salt/common/tools/sbin/so-playbook-sync @@ -18,7 +18,7 @@ . /usr/sbin/so-common # Check to see if we are already running -IS_RUNNING=$(ps aux | pgrep -f "so-playbook-sync" | wc -l) -[ "$IS_RUNNING" -gt 3 ] && echo "$(date) - Multiple Playbook Sync processes already running...exiting." && exit 0 +NUM_RUNNING=$(pgrep -cf "so-playbook-sync") +[ "$NUM_RUNNING" -gt 1 ] && echo "$(date) - $NUM_RUNNING Playbook sync processes running...exiting." && exit 0 docker exec so-soctopus python3 playbook_play-sync.py From e65f2a5513fd072f8aed7bfeb200e41e631f93b0 Mon Sep 17 00:00:00 2001 From: Doug Burks Date: Wed, 16 Mar 2022 13:28:39 -0400 Subject: [PATCH 2/2] FIX: Prevent multiple instances of so-sensor-clean #6622 --- salt/common/tools/sbin/so-sensor-clean | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/salt/common/tools/sbin/so-sensor-clean b/salt/common/tools/sbin/so-sensor-clean index 3b871ad80..22a0ae22b 100755 --- a/salt/common/tools/sbin/so-sensor-clean +++ b/salt/common/tools/sbin/so-sensor-clean @@ -115,8 +115,8 @@ clean() { } # Check to see if we are already running -IS_RUNNING=$(ps aux | pgrep -f "so-sensor-clean" | wc -l) -[ "$IS_RUNNING" -gt 3 ] && echo "$(date) - $IS_RUNNING sensor clean script processes running...exiting." >>$LOG && exit 0 +NUM_RUNNING=$(pgrep -cf "so-sensor-clean") +[ "$NUM_RUNNING" -gt 1 ] && echo "$(date) - $NUM_RUNNING sensor clean script processes running...exiting." >>$LOG && exit 0 if [ "$CUR_USAGE" -gt "$CRIT_DISK_USAGE" ]; then while [ "$CUR_USAGE" -gt "$CRIT_DISK_USAGE" ]; do