running java program as daemon on Unix System

Discussion in 'Java' started by Fatih, Apr 8, 2004.

  1. Fatih

    Fatih Guest

    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, Apr 8, 2004
    #1
    1. Advertising

  2. Fatih

    Fatih Guest

    Our java version is 1.4.1_02a-b01.

    "Fatih" <> wrote in message
    news:c53cnf$2o3p34$-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
    >
    >
    Fatih, Apr 8, 2004
    #2
    1. Advertising

  3. 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
    Gordon Beaton, Apr 8, 2004
    #3
  4. Fatih

    Fatih Guest

    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
    Fatih, Apr 9, 2004
    #4
  5. Fatih

    Fatih Guest

    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$-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
    >
    >
    Fatih, Apr 9, 2004
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dundonald
    Replies:
    1
    Views:
    466
    Daniel Pitts
    Dec 21, 2007
  2. Jean-Paul Calderone
    Replies:
    0
    Views:
    448
    Jean-Paul Calderone
    Mar 20, 2009
  3. Floris Bruynooghe
    Replies:
    1
    Views:
    443
    Floris Bruynooghe
    Mar 24, 2009
  4. Replies:
    11
    Views:
    191
    Ted Zlatanov
    Jun 27, 2006
  5. Daemon Win32::Daemon;

    , Sep 7, 2006, in forum: Perl Misc
    Replies:
    0
    Views:
    240
Loading...

Share This Page