summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2017-05-16 23:18:07 +0200
committerJulian Andres Klode <jak@debian.org>2017-05-16 23:18:07 +0200
commit3819004c2cb3893bfa136f3c44a5783c42cd2a8d (patch)
tree55057c0b81687dfbe779257cd29c12c0e3a59741
parent7b4581cbe8fcf6e2bd56a27c5a7a1e6ea33d2973 (diff)
apt.systemd.daily: Drop the LOCKFD variable
Gbp-Dch: ignore
-rwxr-xr-xdebian/apt.systemd.daily9
1 files changed, 3 insertions, 6 deletions
diff --git a/debian/apt.systemd.daily b/debian/apt.systemd.daily
index d2a0bfbed..0ecbde219 100755
--- a/debian/apt.systemd.daily
+++ b/debian/apt.systemd.daily
@@ -291,17 +291,14 @@ debug_echo()
}
# ------------------------ main ----------------------------
-
-# Maintain a lock on fd 3, so we can't run the script twice at the same
-# time.
-
if [ "$1" = "lock_is_held" ]; then
shift
else
- LOCKFD=3
+ # Maintain a lock on fd 3, so we can't run the script twice at the same
+ # time.
eval $(apt-config shell StateDir Dir::State/d)
exec 3>${StateDir}/daily_lock
- if ! flock -w 3600 $LOCKFD; then
+ if ! flock -w 3600 3; then
echo "E: Could not acquire lock" >&2
exit 1
fi