jailkit-users
[Top][All Lists]
Advanced

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

[Jailkit-users] jk_chrootlaunch and STDERR


From: Andrei Sereda
Subject: [Jailkit-users] jk_chrootlaunch and STDERR
Date: Sat, 19 Sep 2009 03:44:47 -0400

Hello everybody,

I'm trying to chroot a java process and having some troubles. Will be
glad if you can help me.

Basically it drills down to having a process output information to
STDERR. I've done a simple script print-echo:

#!/bin/bash

echo >&1 "Echo to STDOUT"
echo >&2 "Echo to STDERR"

When executing the script as 'jk_chrootlaunch -j /srv/java -u test -x
/srv/java/home/test/print-echo' the output is

address@hidden ~]# jk_chrootlaunch -j /srv/java -u test -x
/srv/java/home/test/print-echo
Echo to STDOUT

while for direct call /srv/java/home/test/print-echo the result is (as expected)

address@hidden ~]# /srv/java/home/test/print-echo
Echo to STDOUT
Echo to STDERR

using strace reveals the common error : -1 EBADF (Bad file descriptor)

I know that jailkit closes all descriptors except stdin, stdout and
stderr but, still, it is supposed to work ?

see jk_chrootlaunch.c source:
/* open file descriptors can be used to break out of a chroot, so we
close all of them, except for stdin,stdout and stderr */
while (i-- > 2) {
        while (close(i) != 0 && errno == EINTR);
 }


Thanks for your help,
Andrei.




reply via email to

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