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

correctly spell daemon.

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