'wineconsole --use-event=52' consumes all available cpu

Questions about Wine on Linux
Locked
greenseeker
Newbie
Newbie
Posts: 2
Joined: Sun Dec 13, 2020 11:24 am

'wineconsole --use-event=52' consumes all available cpu

Post by greenseeker »

I have a Tribes 2 server running under wine and I've set it up as a systemd service.

When started this way a 'wineconsole --use-event=52' process is spawned that consumes all available cpu. I've read that this is a side effect of stdin being attached to /dev/null when run in the background like this, and that seems to be accurate; when I launch from a shell there is no such problem.

I've successfully attached stdin to /dev/tty42 in my unit file now, but because there are so many layers between the service and the actual resulting processes that I suspect those processes are not inheriting this setting.

t2server.service:

Code: Select all

[Unit]
Description=Tribes 2 Dedicated Server
Requires=network.target
After=network.target

[Service]
Type=simple
Environment=TERM=xterm-256color
Environment=PYTHONUNBUFFERED=1
User=t2server
CPUAffinity=0
ExecStart=/usr/local/bin/t2server/t2server 
ExecStop=/usr/bin/wineserver -k
Restart=on-failure
RestartSec=10s
TimeoutStopSec=60s
WorkingDirectory=/opt/t2server/GameData
LogsDirectory=t2server
StandardInput=tty-force
StandardOutput=tty-force
TTYPath=/dev/tty42
DeviceAllow=/dev/tty42
ProtectSystem=full
ProtectHome=true
SystemCallFilter=@system-service
NoNewPrivileges=true
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectKernelLogs=true
ProtectControlGroups=true
ProtectClock=true
ProtectHostname=true
PrivateTmp=true

[Install]
WantedBy=multi-user.target
/usr/local/bin/t2server/t2server is a python script which performs some maintenance tasks, checks some config values, and then ultimately launches

Code: Select all

wineconsole --backend=curses cmd /c Tribes2.exe -dedicated {args}
...or any of these various approaches I've tried...

Code: Select all

wineconsole --backend=curses Tribes2.exe -dedicated {args}
xvfb-run -a wine Tribes2.exe -dedicated {args}
xvfb-run -a wineconsole Tribes2.exe -dedicated {args}
xvfb-run -a wineconsole --backend=curses Tribes2.exe -dedicated {args}
dtach -c ~/console wineconsole --backend=curses Tribes2.exe -dedicated {args}
screen -dmS t2server wineconsole --backend=curses Tribes2.exe -dedicated {args}
...and probably others I've forgotten. None have solved this problem of cpu consumption.

I'm hoping maybe someone here might know the secret ingredient I'm missing.
greenseeker
Newbie
Newbie
Posts: 2
Joined: Sun Dec 13, 2020 11:24 am

Re: 'wineconsole --use-event=52' consumes all available cpu

Post by greenseeker »

It turns out stdin -> /dev/null is not the issue, as even when I run it interactively that is how wineconsole is spawned.
Locked