[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Handle-info] Starting and stopping the handle server from Unix rc scripts [SEC=UNCLASSIFIED]



If your Linux has the "setsid" executable, you might find it preferable to "nohup".

From http://bytes.com/topic/java/answers/528276-subject-detach-daemon :

"A daemon changes its working directory, forks, redirects output
streams to /dev/null, detaches from the controlling terminal by
calling setsid(), and forks again. You'll be hard pressed to
accomplish most of that in Java.  Perhaps what you want is this instead:

$ setsid java MyApp /dev/null 2>&1 &

or

$ ( setsid java MyApp /dev/null 2>&1 & ) &

to get the extra fork."

Robert

On 2010-07-29, at 17:46, Chadwick, Philip wrote:

> Hi Robert,
> 
> Thank you for a very sensible and helpful response.
> 
> Several others have also pointed out that swing is not used in the
> handle server, and there is no need for a frame buffer.
> 
> I am sure that nohup(1) would avoid most problems arising from sharing a
> controlling terminal with other process, as SIGHUP is the signal you
> would most often see -- when any process group leader did an exit(2).
> However it's still very undesirable to expose a daemon to signals from
> random other processes (which have the right to send any signal they
> like to process group members).
> 
> I see that Tanuki is well regarded (the Apache foundation "endorse" it).
> However I can't find documentation on *exactly* what it does, and it
> also looks to be very heavy weight.
> 
> I will post my start/stop script solution as soon as I have tested it.
> 
> Cheers,
> 
> -- 
> Phil


_______________________________________________
Handle-Info mailing list
Handle-Info@cnri.reston.va.us
http://www.handle.net/mailman/listinfo/handle-info