[Erp5-report] r45831 luke - in /erp5/trunk/utils/Products.TIDStorage/Products/TIDStorage: ....

nobody at svn.erp5.org nobody at svn.erp5.org
Wed May 4 15:36:37 CEST 2011


Author: luke
Date: Wed May  4 15:36:36 2011
New Revision: 45831

URL: http://svn.erp5.org?rev=45831&view=rev
Log:
Write always pidfile.

Modified:
    erp5/trunk/utils/Products.TIDStorage/Products/TIDStorage/CHANGES
    erp5/trunk/utils/Products.TIDStorage/Products/TIDStorage/bin/tidstorage.py

Modified: erp5/trunk/utils/Products.TIDStorage/Products/TIDStorage/CHANGES
URL: http://svn.erp5.org/erp5/trunk/utils/Products.TIDStorage/Products/TIDStorage/CHANGES?rev=45831&r1=45830&r2=45831&view=diff
==============================================================================
--- erp5/trunk/utils/Products.TIDStorage/Products/TIDStorage/CHANGES [utf8] (original)
+++ erp5/trunk/utils/Products.TIDStorage/Products/TIDStorage/CHANGES [utf8] Wed May  4 15:36:36 2011
@@ -2,3 +2,4 @@
 ------------------
 
  * <product-config tidstorage> section is supported in zope.conf [Łukasz Nowak]
+ * write always pidfile, even if not forking [Łukasz Nowak]

Modified: erp5/trunk/utils/Products.TIDStorage/Products/TIDStorage/bin/tidstorage.py
URL: http://svn.erp5.org/erp5/trunk/utils/Products.TIDStorage/Products/TIDStorage/bin/tidstorage.py?rev=45831&r1=45830&r2=45831&view=diff
==============================================================================
--- erp5/trunk/utils/Products.TIDStorage/Products/TIDStorage/bin/tidstorage.py [utf8] (original)
+++ erp5/trunk/utils/Products.TIDStorage/Products/TIDStorage/bin/tidstorage.py [utf8] Wed May  4 15:36:36 2011
@@ -711,10 +711,10 @@ signal.signal(signal.SIGTERM, TERMHandle
 tid_file = openTIDLog()
 sys.stdout = sys.stderr = openLog()
 
+pidfile = open(options.pidfile_name, 'w')
 if options.fork:
   os.chdir('/')
   os.umask(027)
-  pidfile = open(options.pidfile_name, 'w')
   pid = os.fork()
   if pid == 0:
     os.setsid()
@@ -733,5 +733,7 @@ if options.fork:
   else:
     os._exit(0)
 else:
+  pidfile.write(str(os.getpid()))
+  pidfile.close()
   server(options.address, options.port)
 



More information about the Erp5-report mailing list