[Erp5-report] r24504 - in /erp5/trunk/utils/oood: config.py oood.conf runserw.py start.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Thu Nov 6 09:49:03 CET 2008
Author: kazuhiko
Date: Thu Nov 6 09:49:01 2008
New Revision: 24504
URL: http://svn.erp5.org?rev=24504&view=rev
Log:
Xvfb is no longer required for OOo 2.3 or later.
Modified:
erp5/trunk/utils/oood/config.py
erp5/trunk/utils/oood/oood.conf
erp5/trunk/utils/oood/runserw.py
erp5/trunk/utils/oood/start.py
Modified: erp5/trunk/utils/oood/config.py
URL: http://svn.erp5.org/erp5/trunk/utils/oood/config.py?rev=24504&r1=24503&r2=24504&view=diff
==============================================================================
--- erp5/trunk/utils/oood/config.py [utf8] (original)
+++ erp5/trunk/utils/oood/config.py [utf8] Thu Nov 6 09:49:01 2008
@@ -86,7 +86,6 @@
pool_port_range_start = config.getint('Pool', 'pool_port_range_start')
instance_load_time = config.getint('Pool', 'instance_load_time')
instance_timeout = config.getint('Pool', 'instance_timeout')
-virtual_display_id = config.getint('Pool', 'virtual_display_id')
pool_size = 1 # do not change this
Modified: erp5/trunk/utils/oood/oood.conf
URL: http://svn.erp5.org/erp5/trunk/utils/oood/oood.conf?rev=24504&r1=24503&r2=24504&view=diff
==============================================================================
--- erp5/trunk/utils/oood/oood.conf [utf8] (original)
+++ erp5/trunk/utils/oood/oood.conf [utf8] Thu Nov 6 09:49:01 2008
@@ -72,8 +72,6 @@
instance_load_time = 20
# seconds to wait before killing and restarting OOo instance
instance_timeout = 360
-# ID of the virtual display where OOo instances are launched
-virtual_display_id = 99
###################################################################
# Formats
Modified: erp5/trunk/utils/oood/runserw.py
URL: http://svn.erp5.org/erp5/trunk/utils/oood/runserw.py?rev=24504&r1=24503&r2=24504&view=diff
==============================================================================
--- erp5/trunk/utils/oood/runserw.py [utf8] (original)
+++ erp5/trunk/utils/oood/runserw.py [utf8] Thu Nov 6 09:49:01 2008
@@ -285,8 +285,6 @@
Log.info(message)
print message
sys.exit(1)
- import start as starter
- starter.startVirtualFrameBuffer()
from dispatcher import Dispatcher, MySerw
if debug:
Modified: erp5/trunk/utils/oood/start.py
URL: http://svn.erp5.org/erp5/trunk/utils/oood/start.py?rev=24504&r1=24503&r2=24504&view=diff
==============================================================================
--- erp5/trunk/utils/oood/start.py [utf8] (original)
+++ erp5/trunk/utils/oood/start.py [utf8] Thu Nov 6 09:49:01 2008
@@ -92,8 +92,6 @@
open('%s/Common.xcu' % common_xcu_dir, 'w').write(
open('%s/Common.xcu' % os.path.dirname(__file__)).read())
- # "'-display :%d' % config.virtual_display_id" argument is not working, that's why we use
- # environnment variable. See "man xhost" for more details.
new_context = os.environ
if on_top:
args_and_env = [ BIN # First arg is always the name of the binary software we execute
@@ -102,7 +100,7 @@
, new_context
]
else:
- new_context['DISPLAY'] = ':%s' % config.virtual_display_id
+ new_context['DISPLAY'] = ''
args_and_env = [ BIN # First arg is always the name of the binary software we execute
, '-invisible'
, '-nologo'
@@ -214,53 +212,6 @@
Log.info("Pool - Flushed: all instances killed")
-def startVirtualFrameBuffer():
- """
- This method start a virtual frame buffer (Xvfb)
- """
- VIRTUAL_SCREEN = 0
- XORG_TMP_PATH = "/tmp/.X11-unix"
- import pwd
- oood_uid = os.getuid()
- oood_gid = os.getgid()
- # Clean previous virtual display if found
- killVirtualFrameBuffer()
- # Remove bad previous socket
- xorg_socket = os.path.join(XORG_TMP_PATH, 'X%s' % config.virtual_display_id)
- if os.path.exists(xorg_socket) and \
- (os.stat(xorg_socket).st_uid != oood_uid or \
- os.stat(xorg_socket).st_gid != oood_gid):
- msg = "Pool - Can't start Virtual Frame Buffer because '%s' is not owned by %s" \
- % (xorg_socket,pwd.getpwuid(os.getuid())[0] )
- Log.warning(msg)
- print msg
- sys.exit(1)
- # Start the new virtual display server
- os.system("Xvfb -ac :%s -screen %s 800x600x16 -fbdir %s &" % ( config.virtual_display_id
- , VIRTUAL_SCREEN
- , config.run_dir
- ))
- Log.info("Pool - Virtual frame buffer started")
- Log.info("Pool - To see the virtual display, run 'xwud -in %s/Xvfb_screen%s'" % (config.run_dir, VIRTUAL_SCREEN))
-
-
-def killVirtualFrameBuffer():
- """
- This method kill the virtual frame buffer (Xvfb)
- """
- # Search all Xvfb process running on display ID given in the config file
- result = getstatusoutput("ps ax | grep 'Xvfb' | grep ':%s'" % config.virtual_display_id)
- # Search the running process
- killed = False
- for process in result[1].splitlines():
- if process.find('grep') == -1:
- pid = int(process.strip().split(' ')[0])
- os.kill(pid, 9)
- killed = True
- if killed:
- Log.info("Pool - Virtual frame buffer killed")
-
-
def showThreadingStatus():
import xmlrpclib
uri = 'http://%s:%d' % (config.server_host, config.server_port)
@@ -345,8 +296,6 @@
sys.exit(0)
elif o in ("-f", "--flush"):
flushPool()
- if not WIN:
- killVirtualFrameBuffer()
sys.exit(0)
elif o in ("-s", "--status", "--stat"):
showPoolStatus()
More information about the Erp5-report
mailing list