[ovs-dev] [PATCH] [patch v2] daemon: Avoid leaking socket fd in daemonize_start()

Ben Pfaff blp at nicira.com
Tue Sep 6 17:20:47 UTC 2011


On Mon, Sep 05, 2011 at 02:34:33PM +0900, Simon Horman wrote:
> When a daemon is set to monitor then saved_daemonize_id
> needs to be closed in both the monitor and daemon processes
> to avoid a leaking a file descriptor. This patch adds the latter.

I don't think that this is correct.

In the case where daemon_pid > 0, fork_notify_startup() closes
saved_daemonize_fd, so this patch would double-close that file
descriptor.  In the case where daemon_pid == 0, though, I think you're
right.  Want to adjust the patch to just change that case?

Did you run the testsuite?  There's a lot of tests for this stuff.

python/ovs/daemon.py probably needs the same change.

Thanks,

Ben.



More information about the dev mailing list