X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=python%2Fovs%2Fdaemon.py;h=f74d7f0a1c5c184912f00192aff5229fd346d099;hb=3442636d01d2a73a557952ad9140de07418c28c2;hp=0d119f202588abf290006f6dbb8aeea0606de28a;hpb=2c8fcc9cd6a7bbb948f6c79879e89c7ed791c9b1;p=sliver-openvswitch.git diff --git a/python/ovs/daemon.py b/python/ovs/daemon.py index 0d119f202..f74d7f0a1 100644 --- a/python/ovs/daemon.py +++ b/python/ovs/daemon.py @@ -1,4 +1,4 @@ -# Copyright (c) 2010, 2011 Nicira Networks +# Copyright (c) 2010, 2011, 2012 Nicira, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -362,7 +362,9 @@ def daemonize_start(): if _fork_and_wait_for_startup() > 0: # Running in parent process. sys.exit(0) + # Running in daemon or monitor process. + os.setsid() if _monitor: saved_daemonize_fd = _daemonize_fd @@ -384,7 +386,6 @@ def daemonize_complete(): _fork_notify_startup(_daemonize_fd) if _detach: - os.setsid() if _chdir: os.chdir("/") _close_standard_fds()