cleanup
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python
|
||||
# $Id: hbc,v 1.3 2005/07/19 20:31:05 andreas Exp $
|
||||
# $Id: hbc,v 1.4 2005/07/20 14:03:46 andreas Exp $
|
||||
import sys, time, socket, os, signal, getopt, string
|
||||
|
||||
PORT=50003
|
||||
@@ -124,6 +124,7 @@ if not msgonly:
|
||||
|
||||
if len(msgboot) > 0:
|
||||
msgboot.append("name=%s" % iam)
|
||||
msgboot.append("time=%s" % time.time())
|
||||
msg=string.join(msgboot,";")
|
||||
while 1:
|
||||
fail=0
|
||||
@@ -160,7 +161,6 @@ if daemon:
|
||||
os.umask(0)
|
||||
|
||||
|
||||
msg="interval=%s;name=%s" % (interval, iam)
|
||||
up=1
|
||||
signal.signal(signal.SIGTERM, handler)
|
||||
signal.signal(signal.SIGHUP, handler)
|
||||
@@ -172,6 +172,7 @@ while up:
|
||||
break
|
||||
for hb_host in hb_hosts:
|
||||
try:
|
||||
msg="interval=%s;name=%s;time=%s" % (interval, iam, time.time())
|
||||
if verbose: print "sock.send('%s', (%s, %s))" % (msg, hb_host, hb_port)
|
||||
sock.sendto(msg, (hb_host, hb_port))
|
||||
except:
|
||||
|
||||
Reference in New Issue
Block a user