[CalendarServer-changes] [1171] CalendarServer/branches/users/tfitz/log-alot-128/lib-patches/twisted .scripts._twistd_unix.patch

source_changes at macosforge.org source_changes at macosforge.org
Mon Feb 12 16:43:33 PST 2007


Revision: 1171
          http://trac.macosforge.org/projects/calendarserver/changeset/1171
Author:   tfitz at apple.com
Date:     2007-02-12 16:43:33 -0800 (Mon, 12 Feb 2007)

Log Message:
-----------
Make sure we're not somehow stomping the log files.

Modified Paths:
--------------
    CalendarServer/branches/users/tfitz/log-alot-128/lib-patches/twisted.scripts._twistd_unix.patch

Modified: CalendarServer/branches/users/tfitz/log-alot-128/lib-patches/twisted.scripts._twistd_unix.patch
===================================================================
--- CalendarServer/branches/users/tfitz/log-alot-128/lib-patches/twisted.scripts._twistd_unix.patch	2007-02-13 00:30:41 UTC (rev 1170)
+++ CalendarServer/branches/users/tfitz/log-alot-128/lib-patches/twisted.scripts._twistd_unix.patch	2007-02-13 00:43:33 UTC (rev 1171)
@@ -2,12 +2,24 @@
 ===================================================================
 --- twisted/scripts/_twistd_unix.py	(revision 19636)
 +++ twisted/scripts/_twistd_unix.py	(working copy)
-@@ -141,6 +141,19 @@
+@@ -126,6 +126,11 @@
+     sys.stdout.flush()
+ 
+ 
++def randstr():
++    from random import choice
++    from string import uppercase
++    return "".join([choice(uppercase) for n in range(10)])
++
+ def daemonize():
+     # See http://www.erlenstar.demon.co.uk/unix/faq_toc.html#TOC16
+     if os.fork():   # launch child and...
+@@ -141,6 +146,19 @@
          except OSError, e:
              if e.errno != errno.EBADF:
                  raise
 +
-+    fout = file(str(os.getpid()) + ".log", "w")
++    fout = file(str(os.getpid()) + "_" + randstr() + ".log", "w")
 +
 +    def trace_verbose(frame, event, arg):
 +        try:

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20070212/134765b3/attachment.html


More information about the calendarserver-changes mailing list