java not working in chrooted environment

Saurabh saurabh.kumar at techblue.co.uk
Wed Oct 9 15:04:02 UTC 2013


Hi everybody,

I have Installed juju on my ubuntu 12.04 machine in a local environment.
I am writing a charm for an application development server, but It could 
not get java.
I have written the install hook to install open_jdk via apt.
Java gets installed, when I manually chroot to the location of this 
machine (chroot /var/lib/lxc/saurabh-local-machine-1/rootfs) and do a 
"which java" command It says "/usr/bin/java". But when I do "java 
-version" it says "*java: error while loading shared libraries: 
libjli.so: cannot open shared object file: No such file or directory* "


On googling a bit I found that I will have to mount proc in the chrooted 
environment. I tried to mount proc using the install hook by adding a 
line " *mount -t proc none /proc*" but it could not mount /proc as in 
logs it says proc already mounted still the application could not get java.
When I manually mount the proc in the chrooted environment and start the 
app server it runs fine and java also starts working.

So my question is how to mount proc using a hook in the chrooted 
environment.
If any body has any idea please help.


Here is the log of that server unit.



2013-10-09 14:20:56 INFO juju.worker.uniter uniter.go:369 committing 
"install" hook
2013-10-09 14:20:56 INFO juju.worker.uniter uniter.go:387 committed 
"install" hook
2013-10-09 14:20:56 DEBUG juju.worker.uniter modes.go:410 ModeContinue 
exiting
2013-10-09 14:20:56 INFO juju.worker.uniter modes.go:408 ModeContinue 
starting
2013-10-09 14:20:56 INFO juju.worker.uniter modes.go:79 continuing after 
"install" hook
2013-10-09 14:20:56 DEBUG juju.worker.uniter modes.go:410 ModeContinue 
exiting
2013-10-09 14:20:56 INFO juju.worker.uniter modes.go:408 
ModeConfigChanged starting
2013-10-09 14:20:56 DEBUG juju.worker.uniter.filter filter.go:407 
discarded config event
2013-10-09 14:20:56 INFO juju.worker.uniter uniter.go:354 running 
"config-changed" hook
2013-10-09 14:20:56 INFO juju.worker.uniter context.go:203 skipped 
"config-changed" hook (not implemented)
2013-10-09 14:20:56 INFO juju.worker.uniter uniter.go:362 ran 
"config-changed" hook
2013-10-09 14:20:56 INFO juju.worker.uniter uniter.go:369 committing 
"config-changed" hook
2013-10-09 14:20:57 INFO juju.worker.uniter uniter.go:387 committed 
"config-changed" hook
2013-10-09 14:20:57 DEBUG juju.worker.uniter modes.go:410 
ModeConfigChanged exiting
2013-10-09 14:20:57 INFO juju.worker.uniter modes.go:408 ModeContinue 
starting
2013-10-09 14:20:57 INFO juju.worker.uniter modes.go:79 continuing after 
"config-changed" hook
2013-10-09 14:20:57 DEBUG juju.worker.uniter modes.go:410 ModeContinue 
exiting
2013-10-09 14:20:57 INFO juju.worker.uniter modes.go:408 ModeStarting 
starting
2013-10-09 14:20:57 INFO juju.worker.uniter uniter.go:354 running 
"start" hook
*2013-10-09 14:20:57 INFO juju.worker.uniter context.go:234 "HOOK mount: 
proc already mounted"*
2013-10-09 14:20:57 INFO juju.worker.uniter uniter.go:362 ran "start" hook
2013-10-09 14:20:57 INFO juju.worker.uniter uniter.go:369 committing 
"start" hook
2013-10-09 14:20:57 INFO juju.worker.uniter uniter.go:387 committed 
"start" hook
2013-10-09 14:20:57 DEBUG juju.worker.uniter modes.go:410 ModeStarting 
exiting
2013-10-09 14:20:57 INFO juju.worker.uniter modes.go:408 ModeContinue 
starting
2013-10-09 14:20:57 INFO juju.worker.uniter modes.go:79 continuing after 
"start" hook
2013-10-09 14:20:57 DEBUG juju.worker.uniter modes.go:410 ModeContinue 
exiting
2013-10-09 14:20:57 INFO juju.worker.uniter modes.go:408 ModeAbide starting
2013-10-09 14:20:57 DEBUG juju.worker.uniter.filter filter.go:382 want 
forced upgrade false
2013-10-09 14:20:57 DEBUG juju.worker.uniter.filter filter.go:486 no new 
charm event



Thanks
saurabh.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju/attachments/20131009/1cd888a5/attachment.html>


More information about the Juju mailing list