Detect whether wineserver is fully started? Signal? File?

Sebastian M. Ernst ernst at pleiszenburg.de
Mon Jun 12 13:22:39 CDT 2017


Dear Wine developers,

I am working on a little Python module which is supposed to make use of
Wine. The module has a dedicated class for managing its own
wineserver-session with its own prefix. It allows me to control
wineserver independently of the lifetime of any Windows executable I run
on top of it and to quit it when my work is done.

Starting and stopping wineserver is no problem. However, what I can not
figure out is how to determine when my wineserver is actually completely
loaded, up and running. After all, the loading process requires quite a
bit of time. Mainly due to my intention of preventing any (hard to
debug) crashes and delays when running Windows executables, I want
wineserver to be fully up & loaded before I run anything on top of it.
The following code snipped illustrates the problem:

os.environ['WINEPREFIX'] = '/some/path'
proc_wineserver = subprocess.Popen(
   ['wineserver', '-f', '-p'], # run persistent in foreground
   stdin = subprocess.PIPE,
   stdout = subprocess.PIPE,
   stderr = subprocess.PIPE,
   shell = False
   )
time.sleep(1) # Placeholder *HACK*. BETTER SOLUTION?
proc_somewinexe = subprocess.Popen(['wine some.exe'], shell = False)

As a temporary hack, for which I am seeking a replacement, I simply
sleep for one second. This is odd on faster PCs and really not enough on
somewhat older hardware (or with slow harddrives instead of SSDs) ...

Is there a signal I can catch or a file I can check (and wait for in a
loop to appear) or anything else which would allow me a clean(er)
solution? Or, alternatively, where in the Wine source code do I have to
look for how the "wine" command does it (?) - looking for wineserver and
firing one up if there is not one before any exe file is executed?

I recently posted a question in the Wine forum with similar content:
https://forum.winehq.org/viewtopic.php?f=2&t=28967

Thanks for any advise,
Sebastian



More information about the wine-devel mailing list