Commit 8b697bd3 authored by Leigh B. Stoller's avatar Leigh B. Stoller

Add -nologfile option to prevent log file creation. The web wrapper

script uses this option so ot can easily capture output.
parent 88dd6be3
......@@ -21,14 +21,26 @@ $ENV{'PATH'} = "/usr/bin:$TBROOT/libexec:$TBROOT/libexec/ir"
push(@INC,$TBSETUPLIB);
push(@INC,$TBIRLIB);
# Turn off line buffering.
$| = 1;
require libtbsetup;
require libir;
require 'ctime.pl';
if ($#ARGV != 2) {
print STDERR "Syntax: $0 pid eid ns_file\n";
if ($#ARGV < 2 || $#ARGV > 3 ||
($#ARGV == 3 && $ARGV[0] ne "-nologfile")) {
print STDERR "Syntax: $0 [-nologfile] pid eid ns_file\n";
exit(1);
}
if ($#ARGV == 3) {
shift;
$dolog = 0;
}
else {
$dolog = 1;
}
($pid,$eid,$nsfile) = @ARGV;
$prefix = &tbs_prefix($nsfile);
......@@ -47,11 +59,13 @@ sub cleanup {
&tbs_exec("nfree $eid $pid");
};
&tbs_initlog($logfile);
if ($dolog) {
&tbs_initlog($logfile);
&tbs_out("Log: $logfile\n");
}
&tbs_out("Input: $nsfile\n");
&tbs_out("Output: $irfile\n");
&tbs_out("Log: $logfile\n");
&tbs_out("\n");
&tbs_out("Beginning pre run for $pid-$eid ($nsfile). "
. &ctime(time) . "\n");
......
......@@ -14,23 +14,33 @@ $ENV{'PATH'} = "$TBROOT/libexec:$TBROOT/libexec/ir"
. ":$TBROOT/libexec/ns2ir:$TBROOT/sbin:$TBROOT/bin:/usr/bin";
push(@INC,$TBSETUPLIB);
# Turn off line buffering.
$| = 1;
require libtbsetup;
require 'ctime.pl';
if ($#ARGV != 2) {
print STDERR "Syntax: $0 pid eid ir_file\n";
if ($#ARGV < 2 || $#ARGV > 3 ||
($#ARGV == 3 && $ARGV[0] ne "-nologfile")) {
print STDERR "Syntax: $0 [-nologfile] pid eid ir_file\n";
exit(1);
}
if ($#ARGV == 3) {
shift;
$dolog = 0;
}
else {
$dolog = 1;
}
($pid,$eid,$irfile) = @ARGV;
$prefix = &tbs_prefix($irfile);
$logfile = "$prefix.log";
&tbs_initlog($logfile);
#&tbs_out("Input: $irfile\n");
#&tbs_out("Log: $logfile\n");
#&tbs_out("\n");
if ($dolog) {
&tbs_initlog($logfile);
}
if (! -r $irfile) {
&tbs_out("$irfile does not exist or is not readable.\n");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment