[Wine] Re: Bash Script Shorcuts for Steam Games

SpawnHappyJake wineforum-user at winehq.org
Sat Sep 24 07:42:45 CDT 2011


Hey, I think there is a bug with gdb. Yes, a bug in the debugger. Other than that, I got it figured out.

You should be able to open terminal, enter "su -", and log into a superuser shell.

>From there you should be able to run something like the following script:


Code:
/bin/su - shjake -c "env WINEPREFIX=/home/shjake/steam wine /home/shjake/steam/drive_c/windows/command/start.exe steam://rungameid/400" &

sleep 25s

hl2Pid=`pgrep hl2.exe`

gdb --pid $hl2Pid &> /home/shjake/Desktop/hl2dbg.log



I keep getting this error back:

Code:
.llegal process-id: [insert number here]



Even if I change "hl2Pid=`pgrep hl2.exe`" to "hl2Pid=`pgrep firefox`" when firefox is running, comment the first two lines out, and just run those last two, I get that error.

But if I copy and paste those exact same lines into the superuser shell, I get debugging info about firefox spewed into hl2dbg.log like I should.

If it weren't for this bug, this is what would be happening:
You are "logged" in as the superuser. Everything has root privileges unless specifically stated otherwise.  
The first line uses 
Code:
/bin/su - [user name] -c "[command]"

 to run Portal in WINE as the normal user that owns WINE. Running WINE as root breaks it.
The first line ends in "&", this makes the next line start even though the first line isn't "done" yet. That's what we need. It won't be "done" until Portal is closed out. In fact, it runs both the first line and the second line at the same time.

The second line gives enough time for the hl2.exe process to appear. You can't run the first line and the third line at the same time, or else we might not find a pid for hl2.exe, because it doesn't exist yet.

The third line creates a variable and passes the pid of hl2.exe to it.
The fourth line is supposed to take the pid out of the variable, use it with gdb, and output debugging info into a log file, but fails to do so from a script, and only works at the "live" terminal.

Hope this gets somewhere,
Jake







More information about the wine-users mailing list