diff --git a/html/cgi-bin/pakfire.cgi b/html/cgi-bin/pakfire.cgi
index f2381f031..4d6eee284 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, "
-
-
-
- |
+# Check if pakfire is already running.
+#
+# The system backpipe command is safe, because no user input is computed.
+my $pid = `pidof pakfire`;
-
- $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. In this case a lockfile is present.
-if (-e $Pakfire::lockfile) {
+if ($pid) {
&Header::openbox( 'Waiting', 1, "" );
print <