From patchwork Mon May 24 17:38:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 4370 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 4Fpkvy1Ydvz3wc9 for ; Mon, 24 May 2021 17:38:38 +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 4Fpkvx4M7Hz5PC; Mon, 24 May 2021 17:38:37 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4Fpkvx490Tz2ybZ; Mon, 24 May 2021 17:38:37 +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 4Fpkvw66Sjz2xZs for ; Mon, 24 May 2021 17:38:36 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4Fpkvw1ZWXzmP; Mon, 24 May 2021 17:38:36 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1621877916; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8wgWaTe7l04Od30YawWJGDnvHjXa2Z/nEHr2Oh5vrQI=; b=Kzr1sLsDBwAE9I6wlkpoH3XB31TprADrdwV/AtKN63F22llByrRnkfk6aMFIFVYOYdnfCt WFgjmXYidYAzMKBw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1621877916; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8wgWaTe7l04Od30YawWJGDnvHjXa2Z/nEHr2Oh5vrQI=; b=B7ppSsVXQFrFH3KLD8MOfqXS9VVqzIo+kVc8BuOcTVubL6QA1IJkvwTlIi13yNbrP5iGwD LXStoZjM2Sg4ppvOVV4JCWefxYj7msedJoj6RiXC4AAwHfGOfd4V63eH+MJuPMbthP27P0 ednQDuxN6E5usgrn2rd3hasLoPZDct0QjZjQRAqrdNlhAJ5AlgjGHWYcUcXCuCrTsqcnO7 2mmm1vvWQ3hrdnvYfcmP3PwxYjTOwMtLuIhULjC92cxLeEu8P7Q53jIdZG/Vu6Vqouqcz0 5qYjXlizJwKq59jAKvukZagpLJq6fWUBY9l/9B5TWIQqR6Nvafnpk0FR5/HHIA== From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH 2/2] pakfire.cgi: Check for locked pakfire before trying to perform operations. Date: Mon, 24 May 2021 19:38:21 +0200 Message-Id: <20210524173821.4596-2-stefan.schantl@ipfire.org> In-Reply-To: <20210524173821.4596-1-stefan.schantl@ipfire.org> References: <20210524173821.4596-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 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" Fixes #12621. Signed-off-by: Stefan Schantl --- html/cgi-bin/pakfire.cgi | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/html/cgi-bin/pakfire.cgi b/html/cgi-bin/pakfire.cgi index a9e12d23c..faaeb4222 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 <