[OPEN-ILS-DEV] srfsh woes

Scott McKellar mck9 at swbell.net
Sat May 19 16:29:49 EDT 2007


What am I missing?

I've been trying to compile and link a complete working copy of
srfsh, but it's not reading the configuration file usefully.

I reported earlier that if the configuration file is empty, or if 
there is no domain, that srfsh segfaults due to a dereferenced NULL.
I was able to avoid that segfault pretty easily with a small
code fix.

Next I started testing with various non-empty configuration files,
based on the sample .srfsh.xml file on the Wiki at:

http://open-ils.org/dokuwiki/doku.php?id=osrf-devel:srfsh_--_.srfsh.xml

First problem: it loads the configuration file, but I could show
with printfs that it fails to find any of the looked-for items in 
it.  Consequently without the previously mentioned fix, it still
segfaults because it doesn't find a domain.  If I avoid the
segfault, the program complains about the lack of a log file.

>From looking at the code, it looks like it wants to find everything
within an <srfsh> aggregate, but there is no such aggregate in the
sample configuration file.  If I replace <bootstrap> with <srfsh>,
or add another layer of aggregation named <srfsh> within <bootstrap>,
then the program can find stuff.  Most stuff, anyway.

Second problem: It still can't find a domain, because the XML tags
are <domain1> and <domain2>.  I added an entry for <domain> (with
no digit on the end) and then srfsh could find it.

Third problem: It couldn't find a logfile entry either, because 
there wasn't one.  I added one.

Finally I was able to load the configuration file and grab all the
goodies I needed from it.

Fourth problem: now that I'm loading the configuration successfully,
srfsh refuses to use it.

In osrf_system.c, the osrf_system_bootstrap_client_resc function
returns zero upon success and non-zero upon failure.  However when
we call this function in srfsh.c, we treat a zero return code as 
a failure.  The program works only if the configuration file 
doesn't.

Is the sample configuration file on the Wiki really correct?  Is 
srfsh really supposed to work only in the absence of a good 
configuration file?  How have you been avoiding the segfaults?
Or have I royally messed something up?

What am I missing?

Scott McKellar
http://home.swbell.net/mck9/


More information about the Open-ils-dev mailing list