[ovs-dev] [PATCH] Ensure that daemon.py's monitor process has no controlling tty

Gordon Good ggood at nicira.com
Thu Dec 13 21:25:39 UTC 2012


From: Gordon Good <ggood at nicira.com>

If daemon.py is used with the --monitor option to create a
monitoring process, that monitoring process ends up inheriting
the process group and session of the parent process. This
change causes setsid() to be called for the monitor process
as well as the daemon process.

Signed-off-by: Gordon Good <ggood at vmware.com>
---
 python/ovs/daemon.py |    1 +
 1 file changed, 1 insertion(+)

diff --git a/python/ovs/daemon.py b/python/ovs/daemon.py
index 650d250..47deec6 100644
--- a/python/ovs/daemon.py
+++ b/python/ovs/daemon.py
@@ -369,6 +369,7 @@ def daemonize_start():
         daemon_pid = _fork_and_wait_for_startup()
         if daemon_pid > 0:
             # Running in monitor process.
+            os.setsid()
             _fork_notify_startup(saved_daemonize_fd)
             _close_standard_fds()
             _monitor_daemon(daemon_pid)
-- 
1.7.9.5




More information about the dev mailing list