In order to change the VM that a java based service uses, you need to do the following in the conf.d file: export GENTOO_VM=<VM> It would be really useful if the config file for resin had an example of this, e.g. #export GENTOO_VM=sun-jdk-1.5 In the case of resin-3.0.21, the normal install requires you to use a 1.5 jvm (1.4 can work, but effort would be needed like with tomcat to separate out the java5 modules).
Created attachment 98338 [details, diff] resin-3.0.21_missing-GENTOO_VM.patch
To me $(java-config --select-vm=<whatever you want> -O) looks better. I'm about to add this as an example around JAVA_HOME. Opinions?
I've already seen bugs about calling java-config in conf.d files breaking when /usr is not mounted yet. Not sure if that was baselayout failure or we just shouldn't do that. IMHO just setting static variables (GENTOO_VM) in conf.d files and having JAVA_HOME (if the service reliese on it) derived from it using java-config (which honours GENTOO_VM) inside init.d script is cleaner approach.
Created attachment 98343 [details, diff] resin-init.dconf.d.patch Ok, what about this approach? If GENTOO_VM is in conf.d/resin there's no need to duplicate it in as JAVA_HOME.
Applied to 3.0.21
Thanks for the quick turn around on this. I like that solution and its probably what other Java services should base themselves on.
I think you should omit the --select-vm after all, so you don't need a fixed java-config to avoid bug 149460. java-config honours GENTOO_VM setting in the env automatically, no need to pass it explicitly like this.
Oh, but as unlord pointed out, GENTOO_VM would need to be exported. Sorry then.