From 0fa4d896026551dc117129aeac98d4c42d1293d8 Mon Sep 17 00:00:00 2001 From: Tobias Mueller Date: Tue, 17 Oct 2023 15:49:25 +0200 Subject: [PATCH] switch: do not run the lock contention check in the background It actually prevents out main script from running because the flock process is still running in the background. --- files/etc/gl-switch.d/sim.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/etc/gl-switch.d/sim.sh b/files/etc/gl-switch.d/sim.sh index bc8b1e2..df329b7 100644 --- a/files/etc/gl-switch.d/sim.sh +++ b/files/etc/gl-switch.d/sim.sh @@ -10,7 +10,7 @@ logger -p notice -t blue-merle-toggle "Called... ${action}" if [ "$action" = "on" ];then mcu_send_message "Blue Merle ${action}" echo "on" > /tmp/sim_change_switch - flock -n /tmp/blue-merle-switch.lock logger -p notice -t blue-merle-toggle "Running Stage 1" || logger -p notice -t blue-merle-toggle "Lockfile busy" & + flock -n /tmp/blue-merle-switch.lock logger -p notice -t blue-merle-toggle "Running Stage 1" || logger -p notice -t blue-merle-toggle "Lockfile busy" flock -n /tmp/blue-merle-switch.lock timeout 90 /usr/bin/blue-merle-switch-stage1 elif [ "$action" = "off" ];then