如何在崩溃或将要崩溃时杀死 wine 进程?

Had*_*den 19 wine

有时,Wine 应用程序会崩溃(降低系统速度并使其几乎无法使用)。在大多数情况下,我可以使用 杀死程序xkill,但有时我必须重新启动,因为 Ubuntu 似乎没有很好的响应(唯一有效的是ALT+ F2,启动器;xkill没有)。我试过使用wineboot -ror-f但它们似乎不太好用..如果有什么不清楚的,请告诉我,我会尽量解释得更好:)

fos*_*dom 36

您可以通过 ALT+F2 或通过终端键入来安全地终止 Wine 会话

wineserver -k
Run Code Online (Sandbox Code Playgroud)

如果它真的不想关机,那么你可以通过

wineserver -k9
Run Code Online (Sandbox Code Playgroud)

  • 执行这些命令后,我仍然看到 `winedevice.exe` 正在运行。 (3认同)

Con*_*nne 16

killall nameofexefile.exe
Run Code Online (Sandbox Code Playgroud)

就像 linux 进程

  • 所以 wineserver -k 会杀死所有的 wine 进程......这就是我的意思......我不使用 killall <file>.exe 因为我经常不知道文件的确切名称(并且当系统变得疯狂时无论如何我都不知道) (2认同)

Dan*_*tos 6

嗯,作为一个 wine 程序员,我经常会把整个该死的东西都弄得一团糟,所以我使用了我的超级特殊的 killwine 脚本。这是一个艰难的死亡(这是wineserver -k这样做的好方法,并且总是首选)。

#!/bin/bash

wine_cellar="${HOME}/.local/share/wine"

if (($#)); then
    if [[ -e "${wine_cellar}/$1" ]]; then
        WINEPREFIX="${wine_cellar}/$1"
        shift
    elif [[ "${1:0:1}" != "-" ]]; then
        echo "ERROR: Didn't understand argument '$1'?" >&2;
        exit 1
    fi
fi

if ((${#WINEPREFIX})); then
    pids=$(
        grep -l "WINEPREFIX=${WINEPREFIX}$" $(
            ls -l /proc/*/exe 2>/dev/null |
            grep -E 'wine(64)?-preloader|wineserver' |
            perl -pe 's;^.*/proc/(\d+)/exe.*$;/proc/$1/environ;g;'
        ) 2> /dev/null |
        perl -pe 's;^/proc/(\d+)/environ.*$;$1;g;'
    )
else
    pids=$(
        ls -l /proc/*/exe 2>/dev/null |
        grep -E 'wine(64)?-preloader|wineserver' |
        perl -pe 's;^.*/proc/(\d+)/exe.*$;$1;g;'
    )
fi

if ((${#pids})); then
    set -x
    kill $* $pids
fi
Run Code Online (Sandbox Code Playgroud)

这假设您的酒前缀在~/.local/share/wine. 用法示例如下:

killwine                       # Just kill all instances of wine
killwine -9                    # Hard kill them all
killwine lotro                 # Only kill wine under ${HOME}/.local/share/wine/lotro
killwine -INT lotro            # Same as above, but use SIGINT
WINEPREFIX=/tmp/crap killwine  # Kill only the instance under /tmp/crap
sudo reboot                    # Pretend you're running windows.
Run Code Online (Sandbox Code Playgroud)

我不知道,但我不认为你会经常在正常或什至正常 + 分期发布中导致各种进程挂在内存中(这个脚本负责什么),但我做了很多,因为入侵服务器和ntdll。

编辑:此脚本仅适用于基于 Linux 的操作系统,并假设 proc 文件系统安装在 /proc 等上。