Commit 7863035f authored by Michel Pelletier's avatar Michel Pelletier

correctly spell daemon.

parent aba092e3
......@@ -19,7 +19,7 @@
<td valign=top><input type=checkbox name="versions:list"
value="<!--#var id-->"></td>
<td valign=top>
<a href="<!--#var SCRIPT_NAME-->/<!--#var id-->"><!--#var id--></a>
<a href="<!--#var SCRIPT_NAME-->/<!--#var id-->/manage_workspace"><!--#var id--></a>
</td>
</tr>
<!--#/in-->
......
......@@ -225,18 +225,18 @@ def stupid_log_write(subsystem, severity, summary, detail, error):
import os
if os.environ.has_key('STUPID_LOG_FILE'):
f=os.environ['STUPID_LOG_FILE']
if f: _stupid_dest=open(f,'a').write
if f: _stupid_dest=open(f,'a')
else:
import sys
_stupid_dest=sys.stderr.write
_stupid_dest=sys.stderr
else:
_stupid_dest=_no_stupid_log
if _stupid_dest is _no_stupid_log: return
_stupid_dest(
_stupid_dest.write(
"------\n"
"%s %s %s %s\n%s\n"
"%s %s %s %s\n%s"
%
(log_time(),
severity_string(severity),
......@@ -245,6 +245,7 @@ def stupid_log_write(subsystem, severity, summary, detail, error):
detail,
)
)
_stupid_dest.flush()
if error:
try:
......
......@@ -142,8 +142,8 @@ import zLOG
#this is a bit of a hack so I dont have to change too much code
def pstamp(message, sev):
zLOG.LOG("zdeamon", sev,
("zdeamon: %s: %s" % (time.ctime(time.time()), message)))
zLOG.LOG("zdaemon", sev,
("zdaemon: %s: %s" % (time.ctime(time.time()), message)))
def heartbeat():
print 'tha-thump'
......@@ -174,21 +174,22 @@ def forkit(attempts = FORK_ATTEMPTS):
return pid
def run(argv, pidfile=''):
if os.environ.has_key('ZDEAMON_MANAGED'):
if os.environ.has_key('ZDAEMON_MANAGED'):
# We're the child at this point. Don't ask. :/
sys.stdin.close()
sys.stdout.close()
sys.stderr.close()
try:
sys.stdin = open('/dev/null', "r")
sys.stdout = open('/dev/null', "r+")
sys.stderr = open('/dev/null', "r+")
except:
zLOG.LOG("z2", zLOG.ERROR, "couldn't close standard files")
## sys.stdin.close()
## sys.stdout.close()
## sys.stderr.close()
## try:
## sys.stdin = open('/dev/null', "r")
## sys.stdout = open('/dev/null', "r+")
## sys.stderr = open('/dev/null', "r+")
## except:
## zLOG.LOG("z2", zLOG.ERROR, "couldn't close standard files")
return
os.environ['ZDEAMON_MANAGED']='TRUE'
os.environ['ZDAEMON_MANAGED']='TRUE'
while 1:
lastt=time.time()
try:
......@@ -206,7 +207,7 @@ def run(argv, pidfile=''):
pf.write(("%s" % os.getpid()))
pf.close()
while 1:
while 1:
if not BEAT_DELAY:
p,s = os.waitpid(pid, 0)
else:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment