running java program as daemon on Unix System

F

Fatih

Hi,

I have written a java socket server program. I want to run it as daemon on
Unix even if I log out the system.
I am using nohup command but when I logout the system, my java sockte server
program is down.
Our Unix System OS is SunOS 5.9 .

How can I run it as daemon which run every time even if I logout.

Can you help me ?
Anyone have some idea.

Thanks in advance.

Fatih
 
G

Gordon Beaton

I have written a java socket server program. I want to run it as
daemon on Unix even if I log out the system. I am using nohup
command but when I logout the system, my java sockte server program
is down. Our Unix System OS is SunOS 5.9 .

How can I run it as daemon which run every time even if I logout.

This should be sufficient:

nohup java MyProg > /dev/null 2>&1 &

Otherwise, this isn't a java issue at all (let alone java
*programming*). It belongs in a sunos or shell newsgroup.

/gordon
 
F

Fatih

If java version is 1.2.2, the command you specified run well. But if java
version 1.4.x, it doesn't run. When I logout the system in the 1.4.x java
version, my program is down.

My command like your command. "nohup java MyProg &".

Thanks.
 
F

Fatih

I have solved the problem.
I searched the java.sun.com web site and found some bug fixes report. Bug
Id: 4755829 includes the solution of this problem.

If your java version is 1.2 and use the nohup command for running the
program as daemon like this "nohup java MyProg &", it is OK and does not
meet any problem.

But if you use the 1.4.x java version or greater than 1.3.1_03 java
releases, you do not use the nohup command for this task. For using nohup
command rightly, you must run command like this "nohup java -Xrs MyProg &",
important point "-Xrs" non-standart option. If you make this, it OK and no
problem.

Important note.
You can this bug page, http://java.sun.com/j2se/1.3/ReleaseNotes.html , bug
id: 4755829.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top