2

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.

2
  • 1
    There is a bash command 'wait' that delays until all child processes are dead... did you try that? Sep 19, 2011 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, 2011 at 16:58

2 Answers 2

1

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.
0

Duplicate of this question, if it's not limited to wine.

That is, in order to wait for non-child processes, you have to check them periodically.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .