Re: Fork and Closing Open Sockets
- From: Beagle <beagle197@xxxxxxxxxxx>
- Date: Mon, 17 Nov 2008 12:03:26 -0800 (PST)
On Nov 17, 10:07 am, Beagle <beagle...@xxxxxxxxxxx> wrote:
Whoops, did "not" say what my question was... I basically want to start a
background process that doesn't inherit any of the open file
descriptors of the parent. Is there a way to do that?
After fork, in the child, iterating thru the list of open fds and
closing them worked.
int pid = fork()
if (pid == 0) {
....
for (int i = 0; i < OPEN_FDS; i++)
close(i);
execl(..);
....
}
On Nov 17, 9:45 am, Beagle <beagle...@xxxxxxxxxxx> wrote:
Folks,
The server pid accepts network connections until the 'host' connection
exits, then all clients exit (e.g. all sockets are closed). A special
case is a recorder shell based client that starts after the first
client connects, but when the host exits, it waits for the shell to
exit before closing the rest of the connections, even though I see in
the logs the server closes all connections.
.
- Follow-Ups:
- Re: Fork and Closing Open Sockets
- From: Robert Nichols
- Re: Fork and Closing Open Sockets
- References:
- Fork and Closing Open Sockets
- From: Beagle
- Re: Fork and Closing Open Sockets
- From: Beagle
- Fork and Closing Open Sockets
- Prev by Date: Re: gateway routing problem
- Next by Date: Re: Where does inetd listen ? Tunnel setup ?
- Previous by thread: Re: Fork and Closing Open Sockets
- Next by thread: Re: Fork and Closing Open Sockets
- Index(es):
Relevant Pages
|