Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|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
add comment

2 Answers

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.
share|improve this answer
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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