From patchwork Thu Dec 2 12:37:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tremer X-Patchwork-Id: 4879 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 4J4b7t222Wz3wt3 for ; Thu, 2 Dec 2021 12:37:30 +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 4J4b7p51YCz3ZZ; Thu, 2 Dec 2021 12:37:26 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4J4b7n6vSCz30Gj; Thu, 2 Dec 2021 12:37:25 +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 4J4b7n08dtz2yRy for ; Thu, 2 Dec 2021 12:37:25 +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 4J4b7m64VWz1QK; Thu, 2 Dec 2021 12:37:24 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1638448644; 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=CGKgct7LeSnuH1BuN+Ql+IfHmVJFr655tTq4Z1yQh98=; b=MQGw7XsySesbCWateRDrGdvzZHiDOtF5SbbjcYxaR6xoq79D2Ma7H4IH1gcP6tuMexGenc lVu90npZi8K3ErDA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1638448644; 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=CGKgct7LeSnuH1BuN+Ql+IfHmVJFr655tTq4Z1yQh98=; b=C8/pgU/Q0Co/Wbf4SEiqRYHnIZHp40G6Zx5xXEL5vHcs/0A1sJf3XuP5xfi8C2sVpy37fi kwhxg1kmAwIeXKeW5S/e/XM0o25pXVFtC/DcsaVIz27O0UhPbzhXzlqAyyYbxTGQ/4zx3X 8KYikiSygNSlNBkWsGpLxWRkjbzd+c/lwg0ovRRZyPDfPSsvvjDE/Waqa85W4Ci0pser2H xFMEp/+3GbHnShJcY3FydpkdnqTULqWVV/FYZO01yg2pq7WJPNqbvZx4LJTHNHPdw/YQ9m kSl1tTkI++cESknd8uhf5OiUxfO1SjGxDnN/1bNr+fb+aM9hnEDEINRE98o/Yw== From: Michael Tremer To: development@lists.ipfire.org Subject: [PATCH 3/3] backup: Fork ISO job into the background in CGI script Date: Thu, 2 Dec 2021 12:37:15 +0000 Message-Id: <20211202123715.2525482-3-michael.tremer@ipfire.org> In-Reply-To: <20211202123715.2525482-1-michael.tremer@ipfire.org> References: <20211202123715.2525482-1-michael.tremer@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: , Cc: Michael Tremer Errors-To: development-bounces@lists.ipfire.org Sender: "Development" In order to be able to run the ISO command on command line it is helpful that the script does not go into background halfway through the process. We should rather start it as a background job straight from the CGI script. Signed-off-by: Michael Tremer --- config/backup/backup.pl | 2 +- html/cgi-bin/backup.cgi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/backup/backup.pl b/config/backup/backup.pl index bed5952de..afd8d1663 100644 --- a/config/backup/backup.pl +++ b/config/backup/backup.pl @@ -247,7 +247,7 @@ main() { local filename="/var/ipfire/backup/${NOW}.ipf" if make_backup "${filename}"; then - /usr/local/bin/backupiso "${NOW}" & + /usr/local/bin/backupiso "${NOW}" fi ;; diff --git a/html/cgi-bin/backup.cgi b/html/cgi-bin/backup.cgi index 84c015314..1b1ccb4a8 100644 --- a/html/cgi-bin/backup.cgi +++ b/html/cgi-bin/backup.cgi @@ -119,7 +119,7 @@ if ( $cgiparams{'ACTION'} eq "backup" ) } elsif ( $cgiparams{'BACKUPLOGS'} eq "exclude" ) { &General::system("/usr/local/bin/backupctrl", "exclude"); } elsif ( $cgiparams{'BACKUPLOGS'} eq "iso" ) { - &General::system("/usr/local/bin/backupctrl", "iso"); + &General::system_background("/usr/local/bin/backupctrl", "iso"); } } if ( $cgiparams{'ACTION'} eq "addonbackup" )