A simple method to switch off Wine?

Questions about Wine on Linux
Locked
fungible
Newbie
Newbie
Posts: 4
Joined: Wed Aug 02, 2017 2:37 am

A simple method to switch off Wine?

Post by fungible »

Hullo. I'm looking for a simple method to temporarily switch off when I'm not using it. Advice please. Thanks.
User avatar
dimesio
Moderator
Moderator
Posts: 13204
Joined: Tue Mar 25, 2008 10:30 pm

Re: A simple method to switch off Wine?

Post by dimesio »

Wine only runs when you run something in it. There's nothing to "switch off."
Barrowman
Level 1
Level 1
Posts: 5
Joined: Fri Apr 24, 2020 12:44 am

Re: A simple method to switch off Wine?

Post by Barrowman »

When I boot my laptop and for the first time after that it takes a fairly long time to start a windows program. After that and until I restart Linux all programs which run under wine start quickly.
This is because the first one I want to run causes wineserver.exe to load and it continues running in the background.
So maybe

Code: Select all

sudo killall -9 wineserver.exe
Would make a difference
User avatar
Bob Wya
Level 12
Level 12
Posts: 3068
Joined: Sat Oct 16, 2010 7:40 pm

Re: A simple method to switch off Wine?

Post by Bob Wya »

Barrowman wrote: Fri Apr 24, 2020 3:25 am ...

Code: Select all

sudo killall -9 wineserver.exe
...
Except you shouldn't be advising folks to run Wine as root! :roll:
See: WineHQ FAQ: 6.2 Should I run Wine as root?

Bob
spoon0042
Level 6
Level 6
Posts: 572
Joined: Thu Dec 24, 2009 11:00 am

Re: A simple method to switch off Wine?

Post by spoon0042 »

May be worth mentioning wineserver command line options. 'wineserver -k' to kill it, 'wineserver -k 9' if you really want that. Specify WINEPREFIX and full path to wineserver if needed. If you need to kill wineserver, which you shouldn't if things are working. :)
Barrowman
Level 1
Level 1
Posts: 5
Joined: Fri Apr 24, 2020 12:44 am

Re: A simple method to switch off Wine?

Post by Barrowman »

@ Bob Wya
I'm not asking anyone to run wineserver as root!

Code: Select all

ls -l /opt/wine-stable/bin/wineserver
-rwxr-xr-x 1 root root 559656 Jan 23  2019 /opt/wine-stable/bin/wineserver
As you can see the owner and group are root so as user I can't kill it except if I run the killall as root.
When I start my computer up wineserver does not run.
It starts the first time I try to run a windows program. It then continues to run until I shut the computer down.
Now all I did was install it so it seems it will inevitably be owned by root.
Unless you know differently
jkfloris
Level 12
Level 12
Posts: 3141
Joined: Thu Aug 14, 2014 10:10 am

Re: A simple method to switch off Wine?

Post by jkfloris »

It then continues to run until I shut the computer down.
This indicates that another Windows program is still running in the background or that the program you are running has not been closed properly.
Use ps ux to find the program.
As you can see the owner and group are root
You also see that everybody has permission to run the wineserver. You could try it yourself:

Code: Select all

# Run winecfg in the background
winecfg &
# Show all user processes
ps ux
...
jkfloris      3233  1.0  0.1  23560 22616 ?        Ss   13:45   0:00 /opt/wine-devel/bin/wineserver
jkfloris      3239  0.1  0.1 1964208 20580 ?       Ssl  13:45   0:00 C:\windows\system32\services.exe
jkfloris      3242  0.2  0.1 1909812 29924 ?       Sl   13:45   0:00 C:\windows\system32\winedevice.exe
jkfloris      3250  0.0  0.1 1830912 17820 ?       Sl   13:45   0:00 C:\windows\system32\plugplay.exe
jkfloris      3255  0.5  0.1 1934092 32016 ?       Sl   13:45   0:00 C:\windows\system32\winedevice.exe
jkfloris      3263  0.1  0.2 1875752 48280 pts/0   Sl   13:45   0:00 C:\windows\system32\explorer.exe /desktop
jkfloris      3266  0.4  0.3 1826396 52204 pts/0   S    13:45   0:00 C:\windows\system32\winecfg.exe
...
# All Windows programs and Wine processes are executed as the user.
 
User avatar
Bob Wya
Level 12
Level 12
Posts: 3068
Joined: Sat Oct 16, 2010 7:40 pm

Re: A simple method to switch off Wine?

Post by Bob Wya »

Barrowman wrote: Sat Apr 25, 2020 4:05 am ...

Code: Select all

ls -l /opt/wine-stable/bin/wineserver
-rwxr-xr-x 1 root root 559656 Jan 23  2019 /opt/wine-stable/bin/wineserver
As you can see the owner and group are root so as user I can't kill it except if I run the killall as root.
...
The wineserver file has permissions:
  • owner (root): read+write+execute
  • group (root): read+execute
  • world: read+execute
So any standard Linux user can execute, or read, this file... On your system.

See: Understanding Linux File Permissions (or any other online guide) ...

Bob
Locked