Connecting to other machines with xboard

Discussion of chess software programming and technical issues.

Moderator: Ras

dollyknot

Connecting to other machines with xboard

Post by dollyknot »

Hello,

Can someone please give me the command line format, to connect two machines, for an engine match via SSH, with one end running xboard. I had it working ages ago, but cannot seem to get the syntax right. My laptop is on wi-fi and I have three boxes physically connected by Ethernet and a router.

Thanks

Peter.
User avatar
hgm
Posts: 28405
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Connecting to other machines with xboard

Post by hgm »

I think the simplest way is to make the ssh command you need to run the engine on the remote machine the engine command.Like

xboard -fcp "ssh user@system gnuchess" -scp fairymax

to play Fairy-Max locally and GNU Chess remote. (I hope I got the ssh command right; I don't really know ssh. But you can try that from the commandprompt first.)
dollyknot

Re: Connecting to other machines with xboard

Post by dollyknot »

Thanks for that HG.

Putting the whole command in quotes was the missing piece in the jigsaw.

xboard -fcp "ssh -v peter@192.168.2.5 /usr/games/crafty" -scp crafty

The only thing I had to change, was to tell xboard where Crafty was installed, which was a bit puzzling, because if I logged into my other machine directly with ssh and ran Crafty from the command line, it just ran because of the bash path command.

And guess who won, yeah you guessed it, it was Crafty!

Peter.

http://dollyknot.com
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Connecting to other machines with xboard

Post by bob »

dollyknot wrote:Thanks for that HG.

Putting the whole command in quotes was the missing piece in the jigsaw.

xboard -fcp "ssh -v peter@192.168.2.5 /usr/games/crafty" -scp crafty

The only thing I had to change, was to tell xboard where Crafty was installed, which was a bit puzzling, because if I logged into my other machine directly with ssh and ran Crafty from the command line, it just ran because of the bash path command.

And guess who won, yeah you guessed it, it was Crafty!

Peter.

http://dollyknot.com
The problem is that ssh remotely executes the thing directly. You could create a remote script named "xcrafty" in inside that, do this:

#!/bin/csh
crafty

and since that gets executed by a local csh copy, it will correctly set the path to find the executable. Note also that whichever way you run it, crafty will expect to find its book in the home directory, as well as TBs, and it will leave log files there, unless you use the -fd or -sd option to send it to a different directory when it executes. -fd goes with -fh program, -sd goes with -sh program, for clarity.
User avatar
hgm
Posts: 28405
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Connecting to other machines with xboard

Post by hgm »

Isn't that non-compliant with Linux standards? I would have expected Crafty to look in /usr/share/games/crafty for things like books. For logs the current directory seems a more logical place, as the average user wouldn't have write access to /usr/share/games/crafty.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Connecting to other machines with xboard

Post by bob »

hgm wrote:Isn't that non-compliant with Linux standards? I would have expected Crafty to look in /usr/share/games/crafty for things like books. For logs the current directory seems a more logical place, as the average user wouldn't have write access to /usr/share/games/crafty.
Depends. For example, if you write a C program that uses "exec()" or one of its cousins to execute a program, no path is searched by exec(). That's up to you to do...

Note that it executes in the user's home directory, and leaves logs and looks for books there. Those that put crafty in something like /usr/share/games or whatever also modify chess.h and set book path to something like /usr/lib/games or whatever as well.

But Crafty always puts logs and such in the current directory unless the default paths are changed in the source... or via the command line / .craftyrc file.
User avatar
hgm
Posts: 28405
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Connecting to other machines with xboard

Post by hgm »

OK, I see. This is probably what the maintainers at Debian do. Put the crafty binary in /usr/games and its data files in /usr/share/games/crafty.

I assumed he was running a Crafty that was in /usr/games or /usr/bin because he says "-fcp crafty" and "-fcp ./crafty".
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Connecting to other machines with xboard

Post by bob »

hgm wrote:OK, I see. This is probably what the maintainers at Debian do. Put the crafty binary in /usr/games and its data files in /usr/share/games/crafty.

I assumed he was running a Crafty that was in /usr/games or /usr/bin because he says "-fcp crafty" and "-fcp ./crafty".
Still would have no idea where it tucks logs and such, however... Obviously not in the lib...