Re: rmid, http start-up on linux
I do feel for you matey but: Woke up this morning in the arms of my girlfriend My flu is much better than it was yesterday Saved myself a few quid on getting the bus because I got my brother to pick me up Been out tonight and had a few too many to drink (It's taken me far too long to write this e-mail!) All in all a very good day! Sorry to hear about your misfortune but I am on your side. The sysadmins should be telling people to keep things in order. It's a big black mark for them that it had to come from you. Take care people and have a good Saturday 14th... Bye bye then... -- Save the whales. Collect the whole set. [EMAIL PROTECTED]http://homepage.ntlworld.com/pogden -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: [ANNOUNCE] Java Unix API pre 1.0
Jurgen
thanks your input is noted.
I thought so `setuid()' would be problem, Linux Threads is exactly the problem.
You would have thought `setuid(0)' would make every single Java Thread
root user, but on Linux this, of course, does not work as expected.
I'ill doc this up and put on the web.
--
I used to live a small town "B-a-r-t-e-r-s-e-a",
over the bridge from the royal bluesy Chelsea,
Stamford bridge and all, I grew up, I lived, I worked,
played the lottery, and found it all just so may be,
Still the house price index got me going
Message History
From: [EMAIL PROTECTED] on 13/10/2000 19:22
To: Peter Pilgrim/DMGIT/DMG UK/DeuBa@DMG UK
cc: [EMAIL PROTECTED]
Subject: Re: [ANNOUNCE] Java Unix API pre 1.0
> "Peter" == Peter Pilgrim <[EMAIL PROTECTED]> writes:
Peter> `JavaUnix' is a portable extension API
Please note that some of these functions are not that portable -- not
even between JVMs on Linux.
E.g.
Peter> (*) Access to UNIX account identification:
Peter> `getuid()' / `setuid()'
The attached test program gives the following output with 1.3 green
threads:
% java -green UIDTest 1000
Thread[main,5,main] 0
Thread[second,5,main] 0
Setting UID to 1000
Thread[main,5,main] 1000
Thread[second,5,main] 1000
with the classic native threads VM or HotSpot it deadlocks:
% java -client UIDTest 1000
Thread[main,5,main] 0
Thread[second,5,main] 0
Setting UID to 1000
Thread[main,5,main] 1000
# 'second' doesn't wake up
If the test wouldn't hang the last line would be
Thread[second,5,main] 0
because UIDs are per-thread with LinuxThreads.
Juergen
PS: Some stuff I've noticed
* Building only works if "." is in PATH
* jar packaging doesn't work
* "extern pid_t getsid(pid_t pid);" should be "extern "C" ..."
(if you define _GNU_SOURCE you don't need this at all)
import javaunix.*;
public class UIDTest
{
static Object lock = new Object();
static boolean started = false;
static boolean goon = false;
public static void main(String[] args)
throws Throwable
{
System.out.println(Thread.currentThread() +
" " +
UnixSystem.getUid());
Thread t = new Thread(new Runnable() {
public void run()
{
System.out.println(Thread.currentThread() +
" " +
UnixSystem.getUid());
synchronized (lock) {
started = true;
lock.notify();
while (!goon) {
try {
lock.wait();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
System.out.println(Thread.currentThread() +
" " +
UnixSystem.getUid());
}
}, "second");
t.start();
synchronized (lock) {
while (!started) {
lock.wait();
}
int uid = Integer.parseInt(args[0]);
System.out.println("Setting UID to " + uid);
UnixSystem.setUid(uid);
System.out.println(Thread.currentThread() +
" " +
UnixSystem.getUid());
goon = true;
lock.notify();
}
t.join();
}
}
--
Juergen Kreileder, Blackdown Java-Linux Team
http://www.blackdown.org/java-linux.html
JVM'01: http://www.usenix.org/events/jvm01/
--
This e-mail may contain confidential and/or privileged information. If you are not the
intended recipient (or have received this e-mail in error) please notify the sender
immediately and destroy this e-mail. Any unauthorised copying, disclosure or
distribution of the material in this e-mail is strictly forbidden.
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: Using JNI from kernel module
Thanks for the replies, I read deeper and recalled my previous kernel experiences. The simple answer, as both of you mentioned, is "you can't do that". Basically, you can only link to functions that are in kernel space, you can't "add" dependencies except those that are in your module. The JNI_ call starts a JVM, it is not a call available in kernel space, it is a .so available with the JDK (not a kernel module). You link it into user space code. I thought a while about adding a "pipe" to a running JVM, similar to that which another gentleman pointed me to. Unfortunately, I was hoping to call methods in a JVM to take advantage of RMI to simplify socket communications :-) Basicallycheat. By using Java code I would be able to create intermediate objects that are more easily maintainable by the general populationA message layer may serve this purpose, but add enough overhead and complexity that the kernel code itself would become its own little mess, combined with the performance degradation of adding the message layer (in addition to the JNI layer). Wellsince I don't have time to write a message layerI guess I'm back to C socket calls. Thank you for the responses. Paul Joi Ellis <[EMAIL PROTECTED]> on 10/18/2000 05:01:04 PM To: [EMAIL PROTECTED] cc: [EMAIL PROTECTED] Subject: Re: Using JNI from kernel module On Wed, 18 Oct 2000 [EMAIL PROTECTED] wrote: > Hi, > > I'm trying to use JNI from a kernel module. One of the first things I have > to do when the module is initialized is create a JVM, to do this I use the > JNI_CreateJavaVM method that is #included from jni.h. Needless to say, > when I do an insmod I receive: > > CRBD.o: unresolved symbol JNI_CreateJavaVM > > Does anyone have any suggstions for how to do this, or a flat out "you > cannot do that"? Hrm. You're trying to put a JVM into the kernel space? I have no idea if that would work or not. But, I know there's a project to put a web server into kernel space. Perhaps putting a JVM into kernel space is possible. I'm not a kernel geek... Try using modprobe instead of insmod. modprobe attempts to resolve module inter-dependancies. IE, if I try to insmod bw_qcam, it whines about video support symbols. It loads fine if I use modprobe bw_qcam instead. Is the thingy which implements JNI_CreateJavaVM also a module? Is it in the kernel's module path? -- Joi EllisSoftware Engineer Aravox Technologies [EMAIL PROTECTED], [EMAIL PROTECTED] No matter what we think of Linux versus FreeBSD, etc., the one thing I really like about Linux is that it has Microsoft worried. Anything that kicks a monopoly in the pants has got to be good for something. - Chris Johnson -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
mpegTV
Has anyone here ever interfaced mpegTV and java? or any other fairly good mpeg player for linux? --Carlos -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
