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

[Git][ftp-team/dak][lockfile] Use flock in security cron.unchecked



Title: GitLab

Bastian Blank pushed to branch lockfile at Debian FTP Team / dak

Commits:

1 changed file:

Changes:

  • config/debian-security/cron.unchecked
    ... ... @@ -22,15 +22,8 @@ last_changed() {
    22 22
         psql -qAtc "SELECT MAX(last_changed) FROM suite WHERE archive_id=(SELECT id FROM archive WHERE name='$1')"
    
    23 23
     }
    
    24 24
     
    
    25
    -cleanup() {
    
    26
    -    rm -f "$LOCKFILE"
    
    27
    -}
    
    28
    -
    
    29
    -if ! lockfile -r8 "$LOCKFILE"; then
    
    30
    -    echo "aborting cron.unchecked because $LOCKFILE has already been locked"
    
    31
    -    exit 0
    
    32
    -fi
    
    33
    -trap cleanup EXIT
    
    25
    +exec {LOCKFD}<>${LOCKFILE}
    
    26
    +flock --exclusive --timeout 600 ${LOCKFD}
    
    34 27
     
    
    35 28
     old_last_changed=$(last_changed security)
    
    36 29
     old_last_changed_build=$(last_changed build-queues)
    


  • Reply to: