[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[snapshot/master] add to git: acquire a reboot lock on import-runs



---
 master/import-run | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/master/import-run b/master/import-run
index dd6e6cf..e0d0835 100755
--- a/master/import-run
+++ b/master/import-run
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 set -e
 set -u
@@ -24,6 +24,12 @@ else
 	verbose=""
 fi
 
+lock=/var/run/reboot-lock
+exec 203< "$lock"
+if ! flock --shared 203; then
+	echo >&2 "Warning: Cannot acquire reboot lock."
+fi
+
 archive="${1:-""}"
 
 #IGNORES="--ignore /Archive-Update-in-Progress-stabile.debian.org --ignore /Archive-Update-Required-stabile.debian.org"
-- 
2.1.4


Reply to: