Proton: Bruteforce kill all proton wineservers option (to be called on steam exit)

Created on 22 Aug 2018  路  12Comments  路  Source: ValveSoftware/Proton

As of now misbehaving winebottles under proton might be tricky to shutdown clean.
Even exiting steam client doesn't clean up running wineservers and tasks.
Thus there needs to be a hard option to kill all bottles on steamexit and also preferrably from CLI for steam-unrelated proton usage.

Most helpful comment

ancient issue, but still open.
I use
PFX=$(lsof | grep compatdata | grep 'pfx$' | awk '{print $NF}')
WINEPREFIX=$PFX wineserver -k
to "gracefully" stop the currently running proton game

All 12 comments

wineserver -k is the command to kill current wineprefix.

I tried it before writing this issue.
Plain wineserver -k doesn't work for proton because it uses a separate prefix from system-wide wine.
To use wineserver -k on non-default prefix you need to specify exact prefix proton uses which is a long name which you need to actually find first because it is generated.
Also they can be multiple.

Besides, It would be just nice of steam not to leave running wineservers on exit even if wineserver -k were working out of the box.

ancient issue, but still open.
I use
PFX=$(lsof | grep compatdata | grep 'pfx$' | awk '{print $NF}')
WINEPREFIX=$PFX wineserver -k
to "gracefully" stop the currently running proton game

@frostworx You rock. This works perfectly every time for me. I threw this in a bash script and bound it to a key combination. Whenever a proton game locks up this kills it immediately for me and I can start it right back up.

Thanks!

hehe, great to hear someone has some use for it! thank you for the friendly feedback! :)

Neat! Thanks frostworx, this will come in very handy. :)

thank you for your feedback as well! :)

Thank you!

I have a script that nukes all misbehaving WINE apps and it was missing the Proton ones.

For reference:

#! /bin/bash
wineserver -k
find $HOME/.PlayOnLinux/wineprefix/* -maxdepth 0 -exec /bin/bash -c 'export WINEPREFIX="{}"; /usr/bin/wineserver -k' \;
PFX=$(lsof | grep compatdata | grep 'pfx$' | awk '{print $NF}')
WINEPREFIX=$PFX wineserver -k
exit 0

nice!
I have the command in a script which is mapped to a amazon-dash button.
so when the steamvr dashboard doesn't work again I can still "exit" the game and continue with another vr game easily ;)
https://github.com/ValveSoftware/SteamVR-for-Linux/issues/255#issuecomment-579315972

@Houkime
Completely agree. Steam must close all Proton processes on exit, since it鈥檚 part of Steam itself.

Honestly, I feel Steam should force kill all Proton processes on each game exit or crash. So each new launch of a game is a fresh clean slate. Running another game from the same old Proton processes that crashed from another game sounds a little mucky and whacky.

When I run wineserver -k, I get command not found: wineserver.

I鈥檓 not surprised, because I don鈥檛 have Wine or Winetricks installed on my system, only Proton through Steam. This means those above scripts have no effect on my Proton processes. I scavenged the internet for alternatives and came up with this script that does indeed kill all Proton processes without Wine or Winetricks being installed.

https://gist.github.com/shoober420/e795942fd4e36a6b1d9d4b88e288a832

ls -l /proc/*/exe 2>/dev/null | grep -E 'wine(64)?-preloader|wineserver' | perl -pe 's;^.*/proc/(\d+)/exe.*$;$1;g;' | xargs -n 1 kill | killall -s9 winedevice.exe tee

sweet thnx so much and I agree this is needed!! on a side note I have discovered (at least for me) that if I close steam before I close a game that leaves wine processes open they seem to close properly

Was this page helpful?
0 / 5 - 0 ratings

Related issues

matou68 picture matou68  路  3Comments

lumni1968 picture lumni1968  路  3Comments

AwesamLinux picture AwesamLinux  路  3Comments

AwesamLinux picture AwesamLinux  路  3Comments

AwesamLinux picture AwesamLinux  路  3Comments