Re: [ilugd] Daemonizing Java
On Wed, 2003-10-01 at 23:11, shah tushar wrote: I am not expert in java but here is my solution that works. Basically you can look into how tomcat startup scripts are written to get more idea. Code at org.apache.catalina.startup.Bootstrap maybe of some help to you. > Can anybody point me to a generic solution for > daemonizing a java application natively (So that it > can daemonize on any platform without any additional > stuff like daemontools ) Not really, "natively on any platform" is a bit of oxymoron when speaking of java. > Also How can I make binaries out of a java file ? In Linux all you need to do is create a elf binary coded in C as in ecliple--a java IDE ( $file eclipse eclipse: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.5, dynamically linked (uses shared libs), not stripped ) or a shell script( an init like script with support for chkconfig ) that spawns the java application(setting up the required classpath and other environment for it) . Only catch is that it is not a cross platform way. Earlier there used to be a Kernel module + system hack for running java applications "natively" on linux( basically calling the jvm for a .class executable marked file --don't know whether its still there) A similar hack is usually/actually used "daemonize" natively a java application in [EMAIL PROTECTED] like platforms as a native service. The shell script way is way to go in linux. Hope that helps. -Tarun Dua http://www.tarundua.net Nothing you ever wanted to find about Tarun Dua ___ ilugd mailing list [EMAIL PROTECTED] http://frodo.hserus.net/mailman/listinfo/ilugd
Re: [ilugd] Daemonizing Java
I don't think you can daemonize a Java application natively. When you say daemonize a Java application, what you mean is daemonizing the JVM and there is no way to do that except by wrapping it in a separate application, which daemonizes itself before it spawns the JVM process. Now there may be other tricks like calling a native OS facility from within your java app and causing the current process to detach from a controlling terminal but I won;t try going there. That is how I understand this and I may be wrong :) As for the second question, GCJ can supposedly compile to native code, but I never tried it. -Achal On Wed, 1 Oct 2003 10:41:16 -0700 (PDT), shah tushar <[EMAIL PROTECTED]> wrote: Hi, Can anybody point me to a generic solution for daemonizing a java application natively (So that it can daemonize on any platform without any additional stuff like daemontools ) Also How can I make binaries out of a java file ? Bye Tushar Shah __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com ___ ilugd mailing list [EMAIL PROTECTED] http://frodo.hserus.net/mailman/listinfo/ilugd -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/ ___ ilugd mailing list [EMAIL PROTECTED] http://frodo.hserus.net/mailman/listinfo/ilugd
[ilugd] Daemonizing Java
Hi, Can anybody point me to a generic solution for daemonizing a java application natively (So that it can daemonize on any platform without any additional stuff like daemontools ) Also How can I make binaries out of a java file ? Bye Tushar Shah __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com ___ ilugd mailing list [EMAIL PROTECTED] http://frodo.hserus.net/mailman/listinfo/ilugd