Re: refdbd maintenance mode fails

David Nebauer <[email protected]> Thu, 12 Oct 2006 21:43:46 +0930
Newsgroups gmane.text.refdb.devel
Message-ID <[email protected]>
David Nebauer wrote:
> After upgrading to svn revision 193 I now get an error when running 
> the command
>    refdbd -a -D "sqlite" -i "/var/lib/refdb/db"
> as part of the debian package install.  It announces the error
>    '(null)' cannot be resolved as a hostname
> and exits with a non-zero return value.

This is a quoting problem.  The postinstall script is assembling the 
following command:

    cmd="refdbd -a -D \"sqlite\" -i \"/var/lib/refdb/db\""

and executing it with a simple

    ${cmd}

This reproducibly causes the error message reported earlier.

As a matter of fact, this error is caused by the quoting of the database 
backend:

----------------------------------------------------------------------------------
# cmd="refdbd -a -D \"sqlite\" -i /var/lib/refdb/db"
# ${cmd}
'(null)' cannot be resolved as a hostname
#
----------------------------------------------------------------------------------

Quoting the main database directory causes a different error:

----------------------------------------------------------------------------------
# cmd="refdbd -a -D sqlite -i \"/var/lib/refdb/db\""
# ${cmd}
maintenance of main database failed
#
----------------------------------------------------------------------------------

Use of single quotes for the internal quoting

    cmd="refdbd -a -D 'sqlite' -i '/var/lib/refdb/db'"

produces the same error.

Removing the internal quotes entirely

    cmd="refdbd -a -D sqlite -i /var/lib/refdb/db"

solves the problem and the command executes without a problem.

At a minimum I must be able to quote the main database directory since 
the user may have placed it in a directory path containing spaces.

Regards,
David.

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642