Reviewed-by: Michael Tremer michael.tremer@ipfire.org
On 12 Oct 2021, at 18:23, Peter Müller peter.mueller@ipfire.org wrote:
Acked-by: Peter Müller peter.mueller@ipfire.org
In case the package list should be grabbed or the system should be upgraded, pakfire got called which writes a lock file to prevent from beeing launched multiple times and to lock the pakfire.cgi with the nice log output.
In case update or upgrade has been performed via WUI, pakfire has been called and written the file in the background but the WUI script has been executed further and because of a race condition it did not recognize the lockfile at this moment because it was not present.
So a simple sleep should to the trick and give pakfire the required time to write out it's lockfile.
Fixes #12696.
Signed-off-by: Stefan Schantl stefan.schantl@ipfire.org
html/cgi-bin/pakfire.cgi | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/html/cgi-bin/pakfire.cgi b/html/cgi-bin/pakfire.cgi index 0cf522ba1..aaf63d469 100644 --- a/html/cgi-bin/pakfire.cgi +++ b/html/cgi-bin/pakfire.cgi @@ -133,8 +133,10 @@ END
} elsif (($cgiparams{'ACTION'} eq 'update') && (! -e $Pakfire::lockfile)) { &General::system_background("/usr/local/bin/pakfire", "update", "--force", "--no-colors");
- sleep(1);
} elsif (($cgiparams{'ACTION'} eq 'upgrade') && (!-e $Pakfire::lockfile)) { &General::system_background("/usr/local/bin/pakfire", "upgrade", "-y", "--no-colors");
- sleep(1);
} elsif ($cgiparams{'ACTION'} eq "$Lang::tr{'save'}") { $pakfiresettings{"TREE"} = $cgiparams{"TREE"};