I often run a game (under wine) which requires a CD. I have made an ISO image of the CD, and have written a script to mount it and then launch the game.

I would like to unmount the image once I have exited the game. Unfortunately, wine forks a child process to launch the game, and does not wait for it to die before exiting itself. As a result, the unmount section of my script is executed before the game launches.

What can I add to my script that will wait for the wine child process(es) to end?

I am running Ubuntu 10.04, wine-1.3.26.

link|improve this question
1  
There is a bash command 'wait' that delays until all child processes are dead... did you try that? – Slartibartfast Sep 19 '11 at 0:06
I could wait() on the wine process that I launch, but this won't wait for the game (forked by wine, not my script) to terminate before returning. – levyd Sep 22 '11 at 16:58
feedback

1 Answer

up vote 1 down vote accepted

It turns out that there is a wineserver option for this problem exactly. From the wineserver man page:

wineserver(1)
    Options
        ...
    -w
        Wait until the currently running wineserver terminates.
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.