어떤 WINEPREFIX가 사용 중인지 확인하는 방법

어떤 WINEPREFIX가 사용 중인지 확인하는 방법

실행할 때 현재 활성화된 wineprefix를 확인하는 명령이 있습니까 wine?

답변1

Windows 환경 "내부"에서 환경 변수를 읽을 수 있습니다 WINEPREFIX. 이를 수행하는 방법은 다음과 같습니다 cmd.

$ WINEPREFIX=/home/lesmana/tmp/somewineprefix wine cmd
(bunch of wine output)
Z:\home\lesmana> echo %WINEPREFIX%
/home/lesmana/tmp/somewineprefix

cmd명령 을 사용하여 다른 환경 변수를 검사할 수 있습니다 set.

없이 와인을 시작했다면 변수 세트 WINEPREFIX가 없습니다 . WINEPREFIX이 경우 wineprefix가 기본값( $HOME/.wine)이어야 합니다.

나는 와인 환경 "외부"에서 wineprefix를 얻는 쉽고 공식적인 방법을 찾지 못했습니다. 해킹은 다음과 같습니다.

먼저 wineserver 프로세스의 PID가 필요합니다.

$ pgrep -fl wineserver
5197 wineserver

그런 다음 프로세스의 환경 변수를 엿볼 수 있습니다.

$ cat /proc/5197/environ | tr '\0' '\n' | grep -i wine
WINEDLLOVERRIDES=winemenubuilder.exe=d;
WINEPREFIX=/home/lesmana/tmp/somewineprefix
_=/usr/bin/wine
WINELOADERNOEXEC=1

또, 없이 와인을 시작했다면 변수 WINEPREFIX는 없을 것이다 WINEPREFIX.

또는 프로세스의 파일 설명자를 확인할 수 있습니다.

$ ls -l /proc/5197/fd | grep wine
lr-x------ 1 lesmana users 64 25. Sep 15:27 114 -> /home/lesmana/tmp/somewineprefix/drive_c/windows
lr-x------ 1 lesmana users 64 25. Sep 15:27 32 -> /home/lesmana/tmp/somewineprefix/drive_c/windows
lr-x------ 1 lesmana users 64 25. Sep 15:27 4 -> /home/lesmana/tmp/somewineprefix
lr-x------ 1 lesmana users 64 25. Sep 15:27 48 -> /home/lesmana/tmp/somewineprefix/drive_c/windows/system32
lr-x------ 1 lesmana users 64 25. Sep 15:27 5 -> /tmp/.wine-1000/server-802-2e0ac4 (deleted)
l-wx------ 1 lesmana users 64 25. Sep 15:27 6 -> /tmp/.wine-1000/server-802-2e0ac4/lock (deleted)

한 가지 문제가 있습니다. 여러 wineserver 프로세스가 있는 경우 어떤 wineserver가 어떤 wine 프로세스에 속하는지 찾아야 합니다. 이번에도 나는 이러한 상관 관계를 만드는 쉬운 방법을 찾지 못했습니다. 내가 찾은 유일한 방법은 프로세스의 타임스탬프를 검사하는 것입니다.

$ ps -ef
...
lesmana   5096  5085  0 22:33 pts/2    00:00:00 /bin/sh /home/lesmana/bin/wine cmd
lesmana   5097  5096  0 22:33 pts/2    00:00:00 cmd
lesmana   5100   614  0 22:33 ?        00:00:02 /usr/bin/wineserver
lesmana   5104   614  0 22:33 ?        00:00:00 C:\windows\system32\services.exe
lesmana   5110   614  0 22:33 ?        00:00:00 C:\windows\system32\explorer.exe /desktop
lesmana   5144   614  0 22:33 ?        00:00:03 C:\windows\system32\winedevice.exe
lesmana   5193  5093  0 22:34 pts/3    00:00:00 /bin/sh /home/lesmana/bin/wine cmd
lesmana   5194  5193  0 22:34 pts/3    00:00:00 cmd
lesmana   5197   614  0 22:34 ?        00:00:06 /usr/bin/wineserver
lesmana   5201   614  0 22:34 ?        00:00:00 C:\windows\system32\services.exe
lesmana   5207   614  0 22:34 ?        00:00:00 C:\windows\system32\explorer.exe /desktop
lesmana   5345   614  0 22:34 ?        00:00:03 C:\windows\system32\winedevice.exe
...

다음은 1분 간격으로 시작된 두 개의 와인 프로세스와 두 개의 와인 서버 프로세스입니다. ps필요한 경우 시간을 초 단위로 보고 할 수 있습니다 .

불행하게도 wineserver 프로세스는 일종의 데몬으로 시작되며 wine 프로세스의 하위 프로세스가 아닙니다. PPID에는 행운이 없습니다.

관련 정보