Hi,
Since we where having issues with tpc on our site, we wanted to debug it in a test environment.

So I've found this in the Open File System & Open Storage System Configuration Reference under tpc:

scan
scans the output of the copy command for a possible error message
describing a failure. If the copy returns a non-zero return code (i.e. failure),
the scanned error message is returned to the client as the reason. Specifying stderr scans only lines written to stderr.

So I've tried to change my tpc configuration line to
ofs.tpc scan stderr pgm /usr/bin/xrdcp -d 3 --server
but no matter if i specify stderr it fails to initialize with

ofs_Config: invalid scan type - stderr

I feel like if you look at src/XrdOfs/XrdOfsConfig.cc 1243

if (!strcmp(val, "scan"))
            {if (!(val = Config.GetWord()))
                {Eroute.Emsg("Config","scan type not specified"); return 1;}
                  if (strcmp(val, "stderr")) Parms.Grab = -2;
             else if (strcmp(val, "stdout")) Parms.Grab = -1;
                {Eroute.Emsg("Config","invalid scan type -",val); return 1;}
             continue;
}

It looks like an else statement is missing, because once scan is inside th configuration it will always run into "the invalid scan type"-line

if (!strcmp(val, "scan"))
            {if (!(val = Config.GetWord()))
                {Eroute.Emsg("Config","scan type not specified"); return 1;}
                  if (strcmp(val, "stderr")) Parms.Grab = -2;
             else if (strcmp(val, "stdout")) Parms.Grab = -1;
                else {Eroute.Emsg("Config","invalid scan type -",val); return 1;}
             continue;
}

Also, I think like its implemented like this:
You can specify echo and both stderr and stdcout will be printed to the servers log.
You should only use scan if you want to limit the tpc's output to either stderr or stdcout.
I've also tried to use the "scan" option without any parameter(yes ... even though the parameters are in curly brackets... )
I think, the way in which it is described in the Open File System & Open Storage System Configuration Reference file is a little misleading.

"By default, stderr and stdout are scanned."

which made me believe I have to put in "scan" in any way to enable the use of "echo".

"Write to the log file all output subject to the scan option."

I feel like "Write to the log file all scanned output. You can limit all output subject to the scan option" would make it a bit clearer, or maybe also add there, that "By default, stderr and stdout are scanned"
Because it is a little arbirtrary that you only use the "scan" option to limit scanned output, not to enable it.
Especially since you cannot enable default scanning expressively and therefore it is kind of "disguised" in the "default" section and so you don't get to know anything about this, if you don't read everything very carefully (Note # 3).

ofs.tpc ttl 7 15 xfr 9 pgm xrdcp --server [-C type]] [-S num]

It would feel a little more intuitive, if it would be enabled by default with "scan all" and limited with "scan stderr/scan stdcout". But even if thats too much to ask for, I believe, it still could be made even clearer ( for lazy people like me) in the configuration file.

Cheers,
JK


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/xrootd/xrootd","title":"xrootd/xrootd","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/xrootd/xrootd"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"XrdOfsConfig Server error ofs_Config: invalid scan type - stderr (#604)"}],"action":{"name":"View Issue","url":"https://github.com/xrootd/xrootd/issues/604"}}}

Use REPLY-ALL to reply to list

To unsubscribe from the XROOTD-DEV list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=XROOTD-DEV&A=1