Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > running java program as daemon on Unix System

Reply
Thread Tools

running java program as daemon on Unix System

 
 
Fatih
Guest
Posts: n/a
 
      04-08-2004
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


 
Reply With Quote
 
 
 
 
Fatih
Guest
Posts: n/a
 
      04-08-2004
Our java version is 1.4.1_02a-b01.

"Fatih" <> wrote in message
news:c53cnf$2o3p34$...
> 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
>
>



 
Reply With Quote
 
 
 
 
Gordon Beaton
Guest
Posts: n/a
 
      04-08-2004
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
 
Reply With Quote
 
Fatih
Guest
Posts: n/a
 
      04-09-2004

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" <> wrote in message
news:40753a63$...
> 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



 
Reply With Quote
 
Fatih
Guest
Posts: n/a
 
      04-09-2004

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" <> wrote in message
news:c53cnf$2o3p34$...
> 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
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: PEP 3143: Standard daemon process library (was: Writing awell-behaved daemon) Floris Bruynooghe Python 1 03-24-2009 02:58 PM
Re: PEP 3143: Standard daemon process library (was: Writing awell-behaved daemon) Jean-Paul Calderone Python 0 03-20-2009 01:02 PM
Problem with memory (unix) allocation to JVM running Java program Dundonald Java 1 12-21-2007 07:00 PM
Daemon Win32::Daemon; ph1975@gmail.com Perl Misc 0 09-07-2006 10:58 AM
Running another program in daemon server janicehwang1325@yahoo.com Perl Misc 11 06-27-2006 06:26 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57