I have a UNIX
daemon process that's been started by a parent process, an application server.
The behavior of this
daemon process is to inherit and use the app
server's file descriptors (ports/sockets).
When I shutdown the app server, the
daemon continues to run, because there may be other applications that want to use it.
However, the app server won't restart, because the
daemon process is holding its parents' ports.
There is a debate as to whether its the app server's or the
daemon's responsibility to close the file descriptors (say, using fcntl(...)).
Which process has the responsibility of closing the open file
descriptors?
Richard Steven, in his Advanced Unix programming book says that the
daemon should do it, but the people who created the
daemon say the
Posix way is better.
Any takers?
Thanks in advance,
Kunal