PNG  IHDR;IDATxܻn0K )(pA 7LeG{ §㻢|ذaÆ 6lذaÆ 6lذaÆ 6lom$^yذag5bÆ 6lذaÆ 6lذa{ 6lذaÆ `}HFkm,mӪôô! x|'ܢ˟;E:9&ᶒ}{v]n&6 h_tڠ͵-ҫZ;Z$.Pkž)!o>}leQfJTu іچ\X=8Rن4`Vwl>nG^is"ms$ui?wbs[m6K4O.4%/bC%t Mז -lG6mrz2s%9s@-k9=)kB5\+͂Zsٲ Rn~GRC wIcIn7jJhۛNCS|j08yiHKֶۛkɈ+;SzL/F*\Ԕ#"5m2[S=gnaPeғL lذaÆ 6l^ḵaÆ 6lذaÆ 6lذa; _ذaÆ 6lذaÆ 6lذaÆ RIENDB` #!/usr/bin/perl # cpanel - installd/apt-get-wait Copyright 2021 cPanel, L.L.C. # All rights reserved. # copyright@cpanel.net http://cpanel.net # This code is subject to the cPanel license. Unauthorized copying is prohibited use strict; use warnings; use File::FcntlLock; # Define our locks, assume all are locked to start my %lock_files = ( '/var/lib/dpkg/lock' => 1, '/var/lib/dpkg/lock-frontend' => 1, '/var/cache/apt/archives/lock' => 1, '/var/lib/apt/lists/' => 1 ); my $args = join( " ", @ARGV ); my $cmd = $0; $cmd =~ s/^(?:.+\/)?(.+)\-wait$/$1/; my $clear = 0; until ($clear) { foreach my $path ( keys %lock_files ) { my $fs = File::FcntlLock->new(); open my $fh, '<', $path or die "Can't open file: $!\n"; if ( !$fs->lock( $fh, F_SETLK ) ) { close($fh) or die "can't close $path: $!"; $lock_files{$path} = 1; # Locking failed: File or segment already locked by other process(es) # wait a tenth of a second and try again select( undef, undef, undef, .10 ); } else { $fs->l_type(F_UNLCK); $fs->lock( $fh, F_SETLK ) or print "Unlocking failed: " . $fs->error . "\n"; close($fh) or print "can't close $path: $! !!!\n"; $lock_files{$path} = 0; } } # If either path is locked, set all paths to locked and start over foreach my $locked ( values %lock_files ) { if ( $locked == 1 ) { foreach my $lock_file_path ( keys %lock_files ) { $lock_files{$lock_file_path} = 1; } $clear = 0; last; } else { $clear = 1; } } } exec "$cmd $args";