From: Stefan Schantl Date: Mon, 15 Nov 2021 20:23:33 +0000 (+0100) Subject: pakfire.cgi: Bring back old logic for log displaying X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b4c9d299712dfa9f3d4afed2196283e0a0ba2310;p=people%2Fstevee%2Fipfire-2.x.git pakfire.cgi: Bring back old logic for log displaying Trying to get rid of the system backpipe check if a pakfire is running does not work very well. It simply makes the code more complex and only introduced some new problems. This commit switches back to the old logic which worked well in the past. Signed-off-by: Stefan Schantl Reviewed-by: Bernhard Bitsch Tested-by: Bernhard Bitsch --- diff --git a/html/cgi-bin/pakfire.cgi b/html/cgi-bin/pakfire.cgi index f2381f0312..4d6eee284c 100644 --- a/html/cgi-bin/pakfire.cgi +++ b/html/cgi-bin/pakfire.cgi @@ -44,8 +44,6 @@ $cgiparams{'VALID'} = ''; $cgiparams{'INSPAKS'} = ''; $cgiparams{'DELPAKS'} = ''; -my $page_lock; - sub refreshpage{&Header::openbox( 'Waiting', 1, "" );print "

$Lang::tr{'pagerefresh'}
";&Header::closebox();} &Header::getcgihash(\%cgiparams); @@ -59,9 +57,8 @@ sub refreshpage{&Header::openbox( 'Waiting', 1, " - - - $Lang::tr{ - - - - $Lang::tr{'pakfire working'} - - - -END - &Header::closebox(); - - # Infinite loop to lock the page until pakfire lockfile is present. - while($page_lock) { - unless (-e $Pakfire::lockfile) { - sleep(1); - } else { - # Release page lock. - undef($page_lock); - - # Break loop. - last; - } - } - - # Perform page reload. - print "\n"; - exit; -} +# Check if pakfire is already running. +# +# The system backpipe command is safe, because no user input is computed. +my $pid = `pidof pakfire`; -# Check if pakfire is already running. In this case a lockfile is present. -if (-e $Pakfire::lockfile) { +if ($pid) { &Header::openbox( 'Waiting', 1, "" ); print <