From: Stefan Schantl Date: Mon, 24 May 2021 17:05:08 +0000 (+0200) Subject: pakfire.cgi: Check for locked pakfire before trying to perform X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fheads%2Fnext-pakfire-lock;p=people%2Fstevee%2Fipfire-2.x.git pakfire.cgi: Check for locked pakfire before trying to perform operations. Fixes #12621. Signed-off-by: Stefan Schantl --- diff --git a/html/cgi-bin/pakfire.cgi b/html/cgi-bin/pakfire.cgi index a9e12d23c1..faaeb4222c 100644 --- a/html/cgi-bin/pakfire.cgi +++ b/html/cgi-bin/pakfire.cgi @@ -54,7 +54,7 @@ sub refreshpage{&Header::openbox( 'Waiting', 1, "/dev/null &"); system("/bin/sleep 1"); -} elsif ($cgiparams{'ACTION'} eq 'upgrade') { +} elsif (($cgiparams{'ACTION'} eq 'upgrade') && (!-e $Pakfire::lockfile)) { my $command = "/usr/local/bin/pakfire upgrade -y --no-colors &>/dev/null &"; system("$command"); system("/bin/sleep 1"); @@ -176,9 +176,7 @@ if ($errormessage) { &Header::closebox(); } -my $return = `pidof pakfire`; -chomp($return); -if ($return) { +if (-e $Pakfire::lockfile) { &Header::openbox( 'Waiting', 1, "" ); print <