[OPEN-ILS-DEV] srfsh woes

Dan Scott denials at gmail.com
Sat May 19 18:01:55 EDT 2007


On 19/05/07, Scott McKellar <mck9 at swbell.net> wrote:
> 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

Ooh. Bad old example file. I'll replace that in the wiki with the
contents of the sample file that gets placed in
/openils/conf/srfsh.xml.example when you actually install Evergreen.

> 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.

Yep. Root element should be <srfsh>.

> 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.

Yep. I believe you can have:

<domains>
  <domain><!-- first domain --></domain>
  <domain><!-- second domain --></domain>
</domains>

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

This is in the sample srfsh.xml.example that gets installed, and I've
updated the wiki accordingly.

> 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?

Nope. Well, it wasn't, but now it is.

Hope this helps!

-- 
Dan Scott
Laurentian University


More information about the Open-ils-dev mailing list