1822896 Members
3580 Online
109645 Solutions
New Discussion юеВ

Deamon and Process

 
tayal_sumit
Occasional Advisor

Deamon and Process

Hi All,

Can anybody tell me what is the difference between a Deamon and Process and also tell me is to possible to create a Deamon manually.


thanks with regards,
4 REPLIES 4
Dennis Handly
Acclaimed Contributor

Re: Deamon and Process

A demon is just a process set up in a special way. I.e. stdio/stdout/stderr is redirected, most often to /dev/null. It is also setup so SIGHUP won't kill it. See this link:
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=206245
Asif Sharif
Honored Contributor

Re: Deamon and Process

Hi Sumit,

Daemon:- a daemon (pronounced /├Л di├Л m├Й n/ or /├Л de├Й┬кm├Й n/[1]) is a computer program that runs in the background, rather than under the direct control of a user; they are usually initiated as background processes. Typically daemons have names that end with the letter "d": for example, syslogd, the daemon that handles the system log, or sshd, which handles incoming SSH connections.

In a Unix environment, the parent process of a daemon is often (but not always) the init process (PID=1). Processes usually become daemons by forking a child process and then having their parent process immediately exit, thus causing init to adopt the child process. This is a somewhat simplified view of things as other operations are generally performed, such as disassociating the daemon process from any controlling tty. Convenience routines such as daemon(3) exist in some UNIX systems for that purpose.

Systems often start (or "launch") daemons at boot time: they often serve the function of responding to network requests, hardware activity, or other programs by performing some task.

Process:- In computing, a process is an instance of a computer program that is being sequentially executed by a computer system that has the ability to run several computer programs concurrently.

A computer program itself is just a passive collection of instructions, while a process is the actual execution of those instructions. Several processes may be associated with the same program; for example, opening up several windows of the same program typically means more than one process is being executed.

http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=85269

Regards,
Asif Sharif
Regards,
Asif Sharif
Kenan Erdey
Honored Contributor

Re: Deamon and Process

Hi,

Simply,daemons are processes running in background waiting for serving.(when it starts it's a process in the memory)

Processes are the form of the program which is running.(more usual form)

Kenan.
Computers have lots of memory but no imagination
Laurent Menase
Honored Contributor

Re: Deamon and Process

easiest way:

nohup myprogram /tmp/log 2>&1 &


It will detach the program from current tty.
-only way to make a deamon-

programatically, the launcher better if create a new process group, close(0), close(1) close(2); after a fflush on stdin stdout and stderr, then open /dev/null or files for 0 1 2
then fork(), and it is done you are a daemon.

If you want an inetd started daemon; it is much more simple because the true daemon is inetd.