Re: Trouble writing background-running program
- From: Guido Scholz <guido.scholz@xxxxxxxxxxxxx>
- Date: Mon, 24 Mar 2008 09:49:30 +0100
Carlos Moreno schrieb:
Carlos,
I of course tried to code the program to work as a daemon, following
the little
recipe and explanations from Stevens' Advanced Programming in the
Unix
Environment (1993 edition) --- I fork, close the parent, then in the
child I call
setsid() ... I skip the rest since my program changes to its "native"
directory
anyway, and it never creates files or directories, so the umask part
is also
unneeded).
does your code execute also the second fork() after setsid(), which is
essential to detach from the terminal properly?
As I recall there is an example code function "daemon_init()" which you
could simply copy and paste for your project.
Guido
--
http://www.bayernline.de/~gscholz/
http://www.lug-burghausen.org/
.
- Follow-Ups:
- Re: Trouble writing background-running program
- From: Carlos Moreno
- Re: Trouble writing background-running program
- References:
- Trouble writing background-running program
- From: Carlos Moreno
- Trouble writing background-running program
- Prev by Date: Trouble writing background-running program
- Next by Date: Re: Trouble writing background-running program
- Previous by thread: Trouble writing background-running program
- Next by thread: Re: Trouble writing background-running program
- Index(es):
Relevant Pages
|