dont daemonize on restart

This commit is contained in:
andreas
2006-11-07 20:25:21 +00:00
parent 4c68b9dea4
commit f5ada84363
+8 -9
View File
@@ -1,5 +1,5 @@
#!/usr/bin/env python #!/usr/bin/env python
# $Id: hbd,v 1.13 2006/11/07 20:21:43 andreas Exp $ # $Id: hbd,v 1.14 2006/11/07 20:25:21 andreas Exp $
# Wait for heartbeat messages and act on them (or their absence) # Wait for heartbeat messages and act on them (or their absence)
# #
import time, os, string, sys, socket, atexit, select, SocketServer, getopt, signal, cPickle import time, os, string, sys, socket, atexit, select, SocketServer, getopt, signal, cPickle
@@ -560,14 +560,13 @@ ilist.append(sock)
serv=SocketServer.TCPServer((hbd_host,hbd_port),HtmlHandler) serv=SocketServer.TCPServer((hbd_host,hbd_port),HtmlHandler)
ilist.append(serv.fileno()) ilist.append(serv.fileno())
if not forground: if not forground and not restart:
if not restart: pid=os.fork()
pid=os.fork() if pid > 0:
if pid > 0: if verbose:
if verbose: print "daemoinizing... pid=%d" % pid
print "daemoinizing... pid=%d" % pid sys.exit(0)
sys.exit(0)
verbose=False verbose=False
os.close(0) os.close(0)
os.close(1) os.close(1)