I have a (pretty simple) Windows console application which I want to run on a Linux server using Wine. When I just run it from the terminal over SSH like
everything works great. It runs fine, does everything it should and CPU usage is pretty low (around 5%).
Problems start when I try to run it in background. Even simple things like
nohup wine myapp.exe
causes CPU usage to skyrocket to 100% (one full core). Redirecting output to /dev/null etc. doesn't help.
I tried running it using upstart with the following settings:
start on runlevel  stop on runlevel [!2345] respawn exec sudo -H -u myuser wine /path/to/my/app.exe &> /dev/null
CPU usage was 100%. I tried several more options, until I found out that the following version (with wineconsole used instead of wine and the "-b" switch added to sudo) works just fine (CPU usage 5-7%):
exec sudo -b -H -u myuser wineconsole /path/to/my/app.exe
The problem is, if I run it like this, upstart doesn't track the pid and so respawn etc. doesn't work. When I add "expect-fork" to the config, CPU usage again rises to 100%. When I add redirection to /dev/null, CPU usage rises to 100%. Basically anything I do causes CPU usage to rise to 100%.
Do you have any ideas what may cause this effect?