Re: deamonizing a program in Unix
From: Villy Kruse (vek_at_station02.ohout.pharmapartners.nl)
Date: 01/05/05
- Next message: gutw_at_knapp.com: "Re: Curses - can I use utf-8 with the form and menu libraries ?"
- Previous message: Florentin Ionescu: "Re: dlopen"
- In reply to: Måns Rullgård: "Re: deamonizing a program in Unix"
- Next in thread: Pappan: "Re: deamonizing a program in Unix"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 05 Jan 2005 09:13:59 GMT
On Tue, 04 Jan 2005 22:37:15 +0100,
Måns Rullgård <mru@inprovide.com> wrote:
>
> It might be desirable to do some initial setup before daemonizing, so
> if something goes wrong, it can be easily reported. Many servers
> attempt to bind() a socket before becoming a deamon, and exit with an
> error code on failure.
>
You might still want to close all unwanted descriptors, but do that very
early in main() before opening sockets and other initial processing.
Perhaps you could leave stdout and stderr as is for error reporting during
start-up, and then later close and reopen stdout and stderr to /dev/null.
Villy
- Next message: gutw_at_knapp.com: "Re: Curses - can I use utf-8 with the form and menu libraries ?"
- Previous message: Florentin Ionescu: "Re: dlopen"
- In reply to: Måns Rullgård: "Re: deamonizing a program in Unix"
- Next in thread: Pappan: "Re: deamonizing a program in Unix"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|