diff --git a/scripts/adb-rimo-import/adb-rimo-import-broker.php b/scripts/adb-rimo-import/adb-rimo-import-broker.php index 3a0a83332..9add81e0a 100644 --- a/scripts/adb-rimo-import/adb-rimo-import-broker.php +++ b/scripts/adb-rimo-import/adb-rimo-import-broker.php @@ -5,16 +5,23 @@ if (PHP_SAPI !== 'cli') { die("This program can only be run on the command line.\n"); } +posix_setrlimit(POSIX_RLIMIT_FSIZE, 1024*1024*1024, 1024*1024*1024); // Limit max filesize to 1 GB + +require("../../config/config.php"); + + /* + * Redirecting output so rlimit for filesize works + */ +$logfile = BASEDIR.'/var/log/adb-rimo-import-broker.log'; +echo "Redirecting output to $logfile\n"; + fclose(STDIN); fclose(STDOUT); fclose(STDERR); - $STDIN = fopen('/dev/null', 'r'); -$STDOUT = fopen('/dev/null', 'w'); -$STDERR = fopen('/dev/null', 'w'); -*/ -require("../../config/config.php"); +$STDOUT = fopen($logfile, 'a'); +$STDERR = fopen($logfile, 'a'); define('mfUI',"cli"); define('FRONKDB_SQLDEBUG',false); @@ -153,7 +160,7 @@ while(1) { // delay for 10 minutes before forking new process if($fork_delay) { - echo "[parent] fork delay: $fork_delay\n"; + //echo "[parent] fork delay: $fork_delay\n"; $fork_delay--; sleep(1); break;