Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   running java program as daemon on Unix System (http://www.velocityreviews.com/forums/t132390-running-java-program-as-daemon-on-unix-system.html)

Fatih 04-08-2004 11:23 AM

running java program as daemon on Unix System
 
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



Fatih 04-08-2004 11:25 AM

Re: running java program as daemon on Unix System
 
Our java version is 1.4.1_02a-b01.

"Fatih" <ferhat_torgaloz@hotmail.com> wrote in message
news:c53cnf$2o3p34$1@ID-179508.news.uni-berlin.de...
> 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
>
>




Gordon Beaton 04-08-2004 11:41 AM

Re: running java program as daemon on Unix System
 
On Thu, 8 Apr 2004 14:23:05 +0300, Fatih wrote:
> 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

--
[ do not email me copies of your followups ]
g o r d o n + n e w s @ b a l d e r 1 3 . s e

Fatih 04-09-2004 06:12 AM

Re: running java program as daemon on Unix System
 

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.

"Gordon Beaton" <not@for.email> wrote in message
news:40753a63$1@news.wineasy.se...
> On Thu, 8 Apr 2004 14:23:05 +0300, Fatih wrote:
> > 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
>
> --
> [ do not email me copies of your followups ]
> g o r d o n + n e w s @ b a l d e r 1 3 . s e




Fatih 04-09-2004 09:40 AM

Re: running java program as daemon on Unix System
 

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.




"Fatih" <ferhat_torgaloz@hotmail.com> wrote in message
news:c53cnf$2o3p34$1@ID-179508.news.uni-berlin.de...
> 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
>
>





All times are GMT. The time now is 05:11 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.