java.net: Wiki

The Source for Java Technology Collaboration


 <<O>>  Difference Topic DaemonCreation (1 - 29 Jun 2005 - Main.unnisworld)
Line: 1 to 1
Added:
>
>
META TOPICPARENT name="BoredWithJava"
What is a Daemon ?

A daemon (or service) is a background process that is designed to run autonomously,with little or not user intervention. The Apache web server http daemon (httpd) is one such example of a daemon.

Basic steps to follow for daemon creation are,

  • Fork off the parent process and allow parent to die.
  • Change file mode mask (umask)
  • Open any logs for writing
  • Create a unique Session ID (SID)
  • Change the current working directory to a safe place
  • Close standard file descriptors
  • Enter actual daemon code

A complete example is given here.?

A more detailed explanation of daemon creation steps can be found here.?

Resources :-


Topic DaemonCreation . { View | Diffs r1 | More }
 XML java.net RSS