ADB Rimo Import Broker redirects its output to logfile now
This commit is contained in:
@@ -5,16 +5,23 @@ if (PHP_SAPI !== 'cli') {
|
|||||||
die("This program can only be run on the command line.\n");
|
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(STDIN);
|
||||||
fclose(STDOUT);
|
fclose(STDOUT);
|
||||||
fclose(STDERR);
|
fclose(STDERR);
|
||||||
|
|
||||||
$STDIN = fopen('/dev/null', 'r');
|
$STDIN = fopen('/dev/null', 'r');
|
||||||
$STDOUT = fopen('/dev/null', 'w');
|
$STDOUT = fopen($logfile, 'a');
|
||||||
$STDERR = fopen('/dev/null', 'w');
|
$STDERR = fopen($logfile, 'a');
|
||||||
*/
|
|
||||||
require("../../config/config.php");
|
|
||||||
|
|
||||||
define('mfUI',"cli");
|
define('mfUI',"cli");
|
||||||
define('FRONKDB_SQLDEBUG',false);
|
define('FRONKDB_SQLDEBUG',false);
|
||||||
@@ -153,7 +160,7 @@ while(1) {
|
|||||||
|
|
||||||
// delay for 10 minutes before forking new process
|
// delay for 10 minutes before forking new process
|
||||||
if($fork_delay) {
|
if($fork_delay) {
|
||||||
echo "[parent] fork delay: $fork_delay\n";
|
//echo "[parent] fork delay: $fork_delay\n";
|
||||||
$fork_delay--;
|
$fork_delay--;
|
||||||
sleep(1);
|
sleep(1);
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user