From patchwork Thu Dec 2 15:39:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo-Andres Hofmann X-Patchwork-Id: 4890 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4J4gBr2PQHz3wtT for ; Thu, 2 Dec 2021 15:40:20 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4J4gBm55tMz3Ny; Thu, 2 Dec 2021 15:40:16 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4J4gBm43Kvz300y; Thu, 2 Dec 2021 15:40:16 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4J4gBl0Cpcz2xXd for ; Thu, 2 Dec 2021 15:40:15 +0000 (UTC) Received: from arche.uberspace.de (arche.uberspace.de [185.26.156.147]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPS id 4J4gBd6Jz5z2cF for ; Thu, 2 Dec 2021 15:40:09 +0000 (UTC) Received: (qmail 22140 invoked from network); 2 Dec 2021 15:40:07 -0000 Received: from localhost (HELO localhost) (127.0.0.1) by arche.uberspace.de with SMTP; 2 Dec 2021 15:40:07 -0000 From: Leo-Andres Hofmann To: development@lists.ipfire.org Subject: [PATCH 4/4] pakfire.cgi: Remove "sleep" after running Pakfire command Date: Thu, 2 Dec 2021 16:39:55 +0100 Message-Id: <20211202153955.1126-4-hofmann@leo-andres.de> X-Mailer: git-send-email 2.27.0.windows.1 In-Reply-To: <20211202153955.1126-1-hofmann@leo-andres.de> References: <20211202153955.1126-1-hofmann@leo-andres.de> MIME-Version: 1.0 ARC-Seal: i=1; s=202003rsa; d=lists.ipfire.org; t=1638459609; a=rsa-sha256; cv=none; b=Q6Q9vaZrpg4+0kt/DEbcifTMexVmDNMLv7SZaNtJJaSUehGU3XLo6NB37BHzUAaD8Fb2qb Gppg1nF2FM/qNcyTXk4V3lTp46W5Gl24ydrKiBvVPrYozmTQdyRB+jLjzO1F/QWqsFCP8v mHMGPurv0QW4hyJ1yvUZW6kdBbdRvOdBkT2rGqddd84M5mnkUEEg/6hQiOgrNsmWGW4L++ m9JD5nSiGW1YBwk4LpKW+QDXezu8OtuNxPVDdrRl9kg7yovBUVeQnUyCG3EBwvh2wAUG4V Rz6wyYoiSOyTpeW2Ufb75VGbdCZhq6ToXUKBYiqknSBZGpxjQhZ1ogu1UcCPUQ== ARC-Authentication-Results: i=1; mail01.ipfire.org; dkim=none; spf=pass (mail01.ipfire.org: domain of hofmann@leo-andres.de designates 185.26.156.147 as permitted sender) smtp.mailfrom=hofmann@leo-andres.de; dmarc=pass (policy=none) header.from=leo-andres.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.ipfire.org; s=202003rsa; t=1638459609; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=55vjlCaQY3aKXPt/i2J84/y/Pekpawj9iuBeyfEiLw4=; b=FcvxYWpT32y94Hg2bpB/RDm76dW5o44E2HLzX42FOITfOkIaCYm1tsv4dvfIDXBlKWSGIl 8/0SpvbvH+EciDZAuGaE0VNXPzHhC/SSLzXhCp6ef6Og2zROVu6pVw1sH69aHVL5rFgT2A YmrmZh+/cktADP5F0phrFRGaIanwSSCjE3sENEG7GpJnFz7WptGxsDQ0A3bMDLHSdW7C02 /HmN348B01YicyVHwSLrrR1U67kJrN6XMo6FuFSfqImHErq2DTFVeh3GDbvNUhEd9ZsJA4 LeD1ZCs/b5Uh2G+nAwqhEKtdaP7qCbF5wCfvplD0eouKlblp1SLy1d7boypHTg== X-Rspamd-Queue-Id: 4J4gBd6Jz5z2cF Authentication-Results: mail01.ipfire.org; dkim=none; spf=pass (mail01.ipfire.org: domain of hofmann@leo-andres.de designates 185.26.156.147 as permitted sender) smtp.mailfrom=hofmann@leo-andres.de; dmarc=pass (policy=none) header.from=leo-andres.de X-Spamd-Result: default: False [-3.68 / 11.00]; BAYES_HAM(-3.00)[99.99%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM(-0.99)[-0.991]; SPF_REPUTATION_HAM(-0.88)[-0.88338842932253]; R_MISSING_CHARSET(0.50)[]; MX_INVALID(0.50)[]; DMARC_POLICY_ALLOW(-0.50)[leo-andres.de,none]; R_SPF_ALLOW(-0.20)[+mx:c]; MIME_GOOD(-0.10)[text/plain]; IP_REPUTATION_HAM(-0.01)[asn: 205766(0.00), country: DE(-0.01), ip: 185.26.156.147(0.00)]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; ASN(0.00)[asn:205766, ipnet:185.26.156.0/24, country:DE]; RCVD_TLS_LAST(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; ARC_SIGNED(0.00)[lists.ipfire.org:s=202003rsa:i=1]; ARC_NA(0.00)[] X-Rspamd-Server: mail01.haj.ipfire.org X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" The extended lockfile test seems to be sufficient to detect a running Pakfire process and display the logs. "Sleep" even proved to be counterproductive, as fast processes can finish in under a second and are then again not detected. Signed-off-by: Leo-Andres Hofmann --- html/cgi-bin/pakfire.cgi | 5 ----- 1 file changed, 5 deletions(-) diff --git a/html/cgi-bin/pakfire.cgi b/html/cgi-bin/pakfire.cgi index 72518a6fe..e14658ffb 100644 --- a/html/cgi-bin/pakfire.cgi +++ b/html/cgi-bin/pakfire.cgi @@ -149,7 +149,6 @@ if (($cgiparams{'ACTION'} eq 'install') && (! &_is_pakfire_busy())) { my @pkgs = split(/\|/, $cgiparams{'INSPAKS'}); if ("$cgiparams{'FORCE'}" eq "on") { &General::system_background("/usr/local/bin/pakfire", "install", "--non-interactive", "--no-colors", @pkgs); - sleep(1); } else { &Header::openbox("100%", "center", $Lang::tr{'request'}); my @output = &General::system_output("/usr/local/bin/pakfire", "resolvedeps", "--no-colors", @pkgs); @@ -187,7 +186,6 @@ END my @pkgs = split(/\|/, $cgiparams{'DELPAKS'}); if ("$cgiparams{'FORCE'}" eq "on") { &General::system_background("/usr/local/bin/pakfire", "remove", "--non-interactive", "--no-colors", @pkgs); - sleep(1); } else { &Header::openbox("100%", "center", $Lang::tr{'request'}); my @output = &General::system_output("/usr/local/bin/pakfire", "resolvedeps", "--no-colors", @pkgs); @@ -224,10 +222,8 @@ END } elsif (($cgiparams{'ACTION'} eq 'update') && (! &_is_pakfire_busy())) { &General::system_background("/usr/local/bin/pakfire", "update", "--force", "--no-colors"); - sleep(1); } elsif (($cgiparams{'ACTION'} eq 'upgrade') && (! &_is_pakfire_busy())) { &General::system_background("/usr/local/bin/pakfire", "upgrade", "-y", "--no-colors"); - sleep(1); } elsif ($cgiparams{'ACTION'} eq "$Lang::tr{'save'}") { $pakfiresettings{"TREE"} = $cgiparams{"TREE"}; @@ -241,7 +237,6 @@ END # Update lists &General::system_background("/usr/local/bin/pakfire", "update", "--force", "--no-colors"); - sleep(1); } }