[3/3] backup: Fork ISO job into the background in CGI script

Message ID 20211202123715.2525482-3-michael.tremer@ipfire.org
State Accepted
Commit 45a5df5a5e220437eca3b9c2743076d727583b67
Headers
Series [1/3] backup: Use filename as specified on console |

Commit Message

Michael Tremer Dec. 2, 2021, 12:37 p.m. UTC
  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 <michael.tremer@ipfire.org>
---
 config/backup/backup.pl | 2 +-
 html/cgi-bin/backup.cgi | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
  

Patch

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" )