Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 103024 - hsqldb: $(which java) in /etc/conf.d/hsqldb fails
Summary: hsqldb: $(which java) in /etc/conf.d/hsqldb fails
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Java team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-18 17:58 UTC by James Le Cuirot
Modified: 2005-11-12 04:35 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
conf.d_hsqldb.diff (conf.d_hsqldb.diff,630 bytes, patch)
2005-11-06 03:42 UTC, Wiktor Wandachowicz
Details | Diff
hsqldb-1.7.3.1-r1.ebuild.patch (hsqldb-1.7.3.1-r1.ebuild.patch,610 bytes, patch)
2005-11-12 04:35 UTC, Wiktor Wandachowicz
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description James Le Cuirot gentoo-dev 2005-08-18 17:58:25 UTC
There is a line in /etc/conf.d/hsqldb that reads JAVA_EXECUTABLE=$(which java). 
This fails because java is not in root's path and the error appears every time 
depscan.sh runs. It should be JAVA_EXECUTABLE=$(java-config -J) though I'm not 
sure if the line is even needed at all since this env is not used in /etc/init.
d/hsqldb but neither are any of the other envs for that matter.
Comment 1 Petteri Räty (RETIRED) gentoo-dev 2005-08-18 23:13:14 UTC
In here the problem is that /usr is not mounted when the depscan.sh is run. I
already told this problem to axxo so he is also aware of this. I suggested we
put /usr/bin/java in there with the new setup but for some reason he did not
like it. The other possibility is to evaluate to command later in
/etc/init.d/hsqldb.
Comment 2 James Le Cuirot gentoo-dev 2005-08-19 04:06:03 UTC
Oh sorry, what I said wasn't quite right was it? It was very late when I made 
this bug and I somehow totally managed to forget what the point of "which" was.
 :P
Comment 3 Thomas Matthijs (RETIRED) gentoo-dev 2005-09-11 05:14:04 UTC
fixed
Comment 4 Wiktor Wandachowicz 2005-11-06 03:40:12 UTC
Hmmm. Even though this bug is marked RESOLVED FIXED, I still got the same problem.

Yesterday I've emerged hsqldb-1.7.3.1-r1 and while starting it from root's
console via "/etc/init.d/hsqldb start" was okay, the server never came up after
doing "rc-update add hsqldb default" and reboot. Instead it only displayed:

 * Starting HSQL Database ...
Config file '/etc/conf.d/hsqldb' does not set one or more of following variables
    JAVA_EXECUTABLE, HSQLDB_JAR_PATH, SERVER_HOME                           [!!]

I've done a small investigation and came up with (probably) suboptimal solution.
I modified the /etc/conf.d/hsqldb script in order to make sure that the correct
'java' executable is present in PATH environment variable.

However, I think this should be attacked in a different way (even though I have
a solution which works for me).
Comment 5 Wiktor Wandachowicz 2005-11-06 03:42:56 UTC
Created attachment 72276 [details, diff]
conf.d_hsqldb.diff

A small and very Gentoo-specific addition to the /etc/conf.d/hsqldb
to make sure that 'java' executable is present in PATH variable.
Comment 6 Petteri Räty (RETIRED) gentoo-dev 2005-11-11 14:17:56 UTC
Sir No: Are you using one of the latest baselayouts? Maybe this has something to
do with the fact that it restricts the stuff that gets to the init script
environment.
Comment 7 Wiktor Wandachowicz 2005-11-11 14:27:01 UTC
(In reply to comment #6)
> Sir No: Are you using one of the latest baselayouts? Maybe this has something
> to do with the fact that it restricts the stuff that gets to the init script
> environment.

I'm not sure. For me it's:

# equery list baselayout
[ Searching for package 'baselayout' in all categories among: ]
 * installed packages
[I--] [  ] sys-apps/baselayout-1.11.13-r1 (0)

and I run mostly x86 packages, unless I have no other choice.
Comment 8 Petteri Räty (RETIRED) gentoo-dev 2005-11-11 14:49:21 UTC
Have you tried running env-update?
Comment 9 Wiktor Wandachowicz 2005-11-12 04:30:54 UTC
Ok, let's forget about that. There is a simple workaround for everybody interested:

In /etc/conf.d/hsqldb the line
JAVA_EXECUTABLE=$(which java 2>/dev/null)

should be changed to:
JAVA_EXECUTABLE=$(java-config --java 2>/dev/null)

Even better is to patch the original hsqldb-1.7.3.1-r1.ebuild to prevent
the problem completely. Patch follows.
Comment 10 Wiktor Wandachowicz 2005-11-12 04:35:11 UTC
Created attachment 72734 [details, diff]
hsqldb-1.7.3.1-r1.ebuild.patch

A patch to change '$(which java)' to '$(java-config --java)' in the
hsqldb-1.7.3.1-r1.ebuild file.

BTW. $(which java) is wrong, because at the time the hsqldb service starts
the /usr directory might not be mounted. So, using $(java-config --java)
is the preferred way to get the full path to the 'java' executable.