[LON-CAPA-cvs] cvs: loncom /debugging_tools db_copy.pl

raeburn raeburn at source.lon-capa.org
Wed Feb 22 12:06:42 EST 2012


raeburn		Wed Feb 22 17:06:42 2012 EDT

  Modified files:              
    /loncom/debugging_tools	db_copy.pl 
  Log:
  - system commands call bash shell explicitly to prevent errors which occur
    when dash shell is used instead (dash is default /bin/sh on Ubuntu).
  
  
Index: loncom/debugging_tools/db_copy.pl
diff -u loncom/debugging_tools/db_copy.pl:1.7 loncom/debugging_tools/db_copy.pl:1.8
--- loncom/debugging_tools/db_copy.pl:1.7	Fri Jun  1 19:00:05 2007
+++ loncom/debugging_tools/db_copy.pl	Wed Feb 22 17:06:42 2012
@@ -18,14 +18,14 @@
 }
 
 
-my $return_code = system("$create_db >& /dev/null");
+my $return_code = system("/bin/bash -c '$create_db >& /dev/null'");
 # create_db exits on 1 if no filename to create was specified and is thus
 # a successful start and stop of the program
 if ($return_code == -1
     || (($return_code >> 8) != 1)) {
     $create_db = '/home/httpd/perl/debug/create_db_dynamic_64_so.3';
     printf("booM %d %d!\n",$return_code,($return_code >> 8 ));
-    $return_code = system("$create_db >& /dev/null");
+    $return_code = system("/bin/bash -c '$create_db >& /dev/null'");
     if ($return_code == -1
 	|| (($return_code >> 8) != 1)) {
 	printf("booM2 %d %d!\n",$return_code,($return_code >> 8 ));
@@ -71,7 +71,7 @@
 	my $file = $_;
 	my $dbref =&lock_db($file);
 	#print("attempting $file\n");
-	system("$dump_db -f $file|$create_db -f $file.new");
+	system("/bin/bash -c '$dump_db -f $file|$create_db -f $file.new'");
 #    print("finishing $dbref\n");
 	rename($file,"$file.old");
 	rename("$file.new","$file");




More information about the LON-CAPA-cvs mailing list