diff options
author | Ben Pfaff <blp@nicira.com> | 2011-01-28 12:44:00 -0800 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2011-02-07 12:50:19 -0800 |
commit | a7ff9bd76312a7733168629d8e4e922d47b0ae46 (patch) | |
tree | 45d3de7951466e04ddddc63f108afa5de337aade /lib/daemon.c | |
parent | 8274ae959ac0b158c3e3206b3810af608fb93785 (diff) |
ovs-vswitchd: Complete daemonization only after initial configuration.
Otherwise when we add support for saving and restoring configuration
of internal devices around kernel module unload and reload, there's
no easy way for the "restore" code to tell when all the interfaces
should be set up and ready for configuration.
Diffstat (limited to 'lib/daemon.c')
-rw-r--r-- | lib/daemon.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/daemon.c b/lib/daemon.c index 9db6c1f8..a8b3fae3 100644 --- a/lib/daemon.c +++ b/lib/daemon.c @@ -475,11 +475,14 @@ daemonize_start(void) } /* If daemonization is configured, then this function notifies the parent - * process that the child process has completed startup successfully. */ + * process that the child process has completed startup successfully. + * + * Calling this function more than once has no additional effect. */ void daemonize_complete(void) { fork_notify_startup(daemonize_fd); + daemonize_fd = -1; if (detach) { setsid(); @@ -487,6 +490,7 @@ daemonize_complete(void) ignore(chdir("/")); } close_standard_fds(); + detach = false; } } |