Re: refdbd maintenance mode fails

Markus Hoenicka <[email protected]> Thu, 12 Oct 2006 14:48:40 +0200
Newsgroups gmane.text.refdb.devel
Message-ID <[email protected]>
David Nebauer <[email protected]> was heard to say:

> This is a quoting problem.

A weird one at that.

  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 seems to be the culprit. I ran the following tests in my bash:

$ refdbd -a -D sqlite -e 0 -l 7 -i 'usr/local/var/lib/refdb/db'
[...]
connected to database server using database:
refdb
current main database version: 2

So the command you're trying to run works perfectly fine. But when I try to do
it like your script:

$ cmd="refdbd -a -D sqlite -e 0 -l 7 -i 'usr/local/var/lib/refdb/db'"

$ echo $cmd
refdbd -a -D sqlite -e 0 -l 7 -i 'usr/local/var/lib/refdb/db'

$ ${cmd}
Database directory:
'usr/local/var/lib/refdb/db'
check main database version
pc51997
Administrator


3306
sqlite
'usr/local/var/lib/refdb/db'
UTF8
refdb
failed to connect to database server using database:
refdb
libdbi could not establish a connection
could not open main database
Can't access or create SQLite database
maintenance of main database failed

That is, running the command as ${cmd} does not consume the quotes as when you
run the very same command in the shell. refdbd receives the quoted arguments
which are no longer properly recognized.

One workaround is to run the command like this:

echo $cmd|sh

although more elegant ways may exist.

regards,
Markus


-- 
Markus Hoenicka
[email protected]
(Spam-protected email: replace the quadrupeds with "mhoenicka")
http://www.mhoenicka.de


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