|
Home > Archive > Unix Programming > September 2007 > daemon process and background process
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
daemon process and background process
|
|
| siddhu 2007-09-18, 7:19 pm |
| Dear Experts,
what is the difference between daemon process and background process?
Does terminal it have to do with terminal signals or hangup signals?
Or is there any other differences?
Regards,
Siddharth
| |
| John Gordon 2007-09-18, 7:19 pm |
| In <1190141288.698539.38820@50g2000hsm.googlegroups.com> siddhu <siddharth.sng@gmail.com> writes:
> what is the difference between daemon process and background process?
A daemon process is a process that is specifically made to run in the
background. It contains code to put itself in the background as soon as
it starts.
More generally, a background process is any process that the user has
chosen to run in the background. For example if you have a very large
sort job to run, you might choose to run it in the background simply
for convenience, to allow you to continue reading mail or editing files
or whatever else you want to work on while the sort job is running.
> Does terminal it have to do with terminal signals or hangup signals?
> Or is there any other differences?
I'm unfamiliar with the technical details; someone else will have to
answer that part of your question.
--
John Gordon A is for Amy, who fell down the stairs
gordon@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"
| |
| Golden California Girls 2007-09-19, 1:29 am |
| siddhu wrote:
> Dear Experts,
>
> what is the difference between daemon process and background process?
> Does terminal it have to do with terminal signals or hangup signals?
> Or is there any other differences?
>
> Regards,
> Siddharth
>
A daemon does not have a controlling terminal and can't get one no matter what
(if designed right)
A background process has a controlling terminal.
| |
| David Schwartz 2007-09-19, 1:29 am |
| On Sep 18, 11:48 am, siddhu <siddharth....@gmail.com> wrote:
> what is the difference between daemon process and background process?
> Does terminal it have to do with terminal signals or hangup signals?
> Or is there any other differences?
As the terms are generally used, a daemon process has no controlling
terminal and is in its own session. A background process is simply in
the background but has a controlling terminal and shares a session.
DS
| |
|
| On Sep 18, 11:48 pm, siddhu <siddharth....@gmail.com> wrote:
> Dear Experts,
>
> what is the difference between daemon process and background process?
> Does terminal it have to do with terminal signals or hangup signals?
> Or is there any other differences?
>
> Regards,
> Siddharth
background process is one which depends on terminal.once we close the
terminal the background is quited.
but if it is daemon process it executed untill we logout from the
system.
| |
| siddhu 2007-09-20, 1:30 pm |
| On Sep 19, 10:06 am, lak <lakindi...@gmail.com> wrote:
> On Sep 18, 11:48 pm, siddhu <siddharth....@gmail.com> wrote:
>
>
>
>
> background process is one which depends on terminal.once we close the
> terminal the background is quited
As far as my knowledge goes program continues to run even if we log
out. Moreove nohup command executes the program in the background even
if we log out.
> but if it is daemon process it executed untill we logout from the
> system.
| |
| ta0kira@yahoo.com 2007-09-24, 1:25 am |
| On Sep 20, 7:37 pm, siddhu <siddharth....@gmail.com> wrote:
> On Sep 19, 10:06 am, lak <lakindi...@gmail.com> wrote:> On Sep 18, 11:48 pm, siddhu <siddharth....@gmail.com> wrote:
>
>
>
>
>
> As far as my knowledge goes program continues to run even if we log
> out. Moreove nohup command executes the program in the background even
> if we log out.
>
>
>
>
> - Show quoted text -
A daemon runs until its main thread ends or until it's terminated by a
signal either from an error, another process (such as init,) or a
user. It's a child of init and is a session leader, whereas a
background process has a controlling terminal and is a child of a
session leader but doesn't control the terminal. It becomes a
foreground process when its session leader gives it terminal control
and should exit when the session leader exits (which doesn't
necessarily have to do with the terminal being open.) Most of the
time virtual terminals (such as xterm) will be freed when no process
has an open file descriptor for it or when the session leader
(normally the shell) exits. There are a few circumstances where the
terminal could be freed while processes initially attached to it
remain running.
Kevin P. Barry
|
|
|
|
|