[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Jailkit-users] Re: Java in jail (Olivier Sessink)

From: le tan vu
Subject: [Jailkit-users] Re: Java in jail (Olivier Sessink)
Date: Sat, 22 Jan 2011 22:56:45 +0700

Thanks Olivier a lot.

Now I get Java worked in Jail by the following steps (this is just java to run java program, not javac to compile java source code):

1. specify a section as below in /etc/jailkit/jk_init.ini file:
comment = necessary file to execute java program
paths = /usr/lib/jdk1.6.0_22/bin/java, /lib/libpthread.so.0, /lib/libdl.so.2, /lib/libc.so.6, /usr/lib/jdk1.6.0_22/jre/lib, /lib/libm.so.6, /lib/libm-2.5.so, /proc/meminfo

2. create a Jail with jk_init:
jk_init -j /home/jail jk_lsh java_libraries basicshell

3. add a user into jail by
jk_jailuser -j /home/jail jailedUser

4. change default shell of jailedUser from jk_lsh shell to /bin/bash shell by modifying /home/jail/etc/passwd file.

5. Log in as jailedUser and set some environment variables as below:
export JAVA_HOME=/usr/lib/jdk1.6.0_22   
export PATH=$PATH:$JAVA_HOME/bin
export LD_LIBRARY_PATH=/usr/lib/jdk1.6.0_22/jre/lib/i386/jli/

6. mount proc folder into jail
mount --bind /proc /chrootedpath/proc

7. Done


Message: 2
Date: Fri, 21 Jan 2011 17:18:58 +0100
From: Olivier Sessink <address@hidden>
Subject: Re: [Jailkit-users] Java in jail
To: address@hidden
Message-ID: <address@hidden>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

On 01/14/2011 04:53 PM, le tan vu wrote:
> Hi all,
> I'm looking for workable configuration for java application which needs
> to issue command "java " command in jail.
> I've configured with "jk_cp -j jail java" but no luck. It did copy some
> libraries as well but when I issued "java", system said " error while
> loading shared libraries: libjli.so: cannot open shared object file: No
> such file or directory", when in fact, this file did exist in jail.

but is it in a normal library search path? environment variable

have you tried to debug the situation with strace? see


Blog http://oli4444.wordpress.com/

Bluefish website http://bluefish.openoffice.nl/
Blog http://oli4444.wordpress.com/

Vu Tan Le

reply via email to

[Prev in Thread] Current Thread [Next in Thread]