File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Linux / UNIX and the fly likes Daemon process exits when Xterm is closed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "Daemon process exits when Xterm is closed" Watch "Daemon process exits when Xterm is closed" New topic

Daemon process exits when Xterm is closed

Karthik Kannan

Joined: Dec 29, 2004
Posts: 12

Our project requirement is to create a java application and run it as a service (daemon) in Solaris. We used Java Service Wrapper to make a java app as a daemon process. The wrapper takes care of creating the daemon process (including file permission, executable scripts, etc.).

We are using Reflection (Xterm via Telnet) to connect to the Solaris box and start the service from there. The problem is that when we close the Xterm window, the deamon process gets killed.
We wanted the service to be alive even after closing the Xterm.

Any solutions to this..

Thanks in advance...
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24199

I'm not familiar with this project, but running a background Java process immune to hangup signals on UNIX is quite easy; the "nohup" program will do this for you. It's hard to imagine how this wrapper thingy would improve on just something like

% nohup java MyClass > outputfile 2> errorfile &

[Jess in Action][AskingGoodQuestions]
I agree. Here's the link:
subject: Daemon process exits when Xterm is closed
It's not a secret anymore!