X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;ds=sidebyside;f=dsa-nagios-checks%2Fsbin%2Fdsa-update-apt-status;h=8eebe1acf513914672d5cf17b996947e7c47da65;hb=b70c49312b88d414500d2e3ff85dda7d1e10c1a9;hp=8a278ce7e757d9f400c82c917060d21cde7434ec;hpb=190a9eb26c2b77d4972f7728a7c7c93dc5d560f4;p=mirror%2Fdsa-nagios.git diff --git a/dsa-nagios-checks/sbin/dsa-update-apt-status b/dsa-nagios-checks/sbin/dsa-update-apt-status index 8a278ce..8eebe1a 100755 --- a/dsa-nagios-checks/sbin/dsa-update-apt-status +++ b/dsa-nagios-checks/sbin/dsa-update-apt-status @@ -63,7 +63,7 @@ fi # run apt-get update, retry a few times if it fails count=0 while [ "$count" -lt "$UPDATE_RUNS" ]; do - apt-get update -qq >/dev/null >&2 + flock -e /var/lib/apt/lists apt-get update -qq >/dev/null >&2 if [ "$?" = "0" ]; then break; fi sleep $(( $RANDOM % 600 )) count="$(( $count + 1 ))"