include 'fake' first arg in exec call

This commit is contained in:
andreas
2010-08-21 14:37:53 +00:00
parent 60ba32f1c7
commit eab48d7974
+4 -4
View File
@@ -1,5 +1,5 @@
#!/usr/bin/env python #!/usr/bin/env python
# $Id: hbd,v 1.24 2010/08/21 14:19:32 andreas Exp $ # $Id: hbd,v 1.25 2010/08/21 14:37:53 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
@@ -26,7 +26,7 @@ INTERVAL=10
GRACE=2 GRACE=2
visual=0 visual=0
os.environ['TZ']='Canada/Eastern'
stdscr=None stdscr=None
win=None win=None
@@ -415,7 +415,7 @@ class HtmlHandler(SocketServer.BaseRequestHandler):
res.append("<meta http-equiv=Refresh content=%d>\n" % 60) res.append("<meta http-equiv=Refresh content=%d>\n" % 60)
res.append("</head>") res.append("</head>")
res.append('<body BGCOLOR="#FFFFFF" LINK="#008000" VLINK="#008000" BACKGROUND="/~andreas/images/tile.marble.gif">') res.append('<body BGCOLOR="#FFFFFF" LINK="#008000" VLINK="#008000" BACKGROUND="/~andreas/images/tile.marble.gif">')
res.append("<H2>Heartbeat status at %s (%s)</H2>" % time.strftime("%H:%M:%S", time.localtime(now)), os.environ.get('TZ','Europe/Berlin')) res.append("<H2>Heartbeat status at %s (%s)</H2>" % (time.strftime("%H:%M:%S", time.localtime(now)), os.environ.get('TZ','Europe/Berlin')))
res.append("<table>") res.append("<table>")
res.append("<tr><th>Host</th><th>State</th><th>IP Addr</th><th>Res</th><th>Last change</th></tr>\n" ) res.append("<tr><th>Host</th><th>State</th><th>IP Addr</th><th>Res</th><th>Last change</th></tr>\n" )
hosts_sorted=hosts.keys() hosts_sorted=hosts.keys()
@@ -657,5 +657,5 @@ if sig == signal.SIGHUP:
pick.dump(msgs) pick.dump(msgs)
pickf.close() pickf.close()
os.execv(sys.argv[0],sys.argv[0]+cmdargs) os.execv(sys.argv[0],[sys.argv[0]]+cmdargs)