?
Solved

Remote Execution

Posted on 1998-09-29
7
Medium Priority
?
252 Views
Last Modified: 2013-12-26
Is there and easy way to execute a program on a unix machine
from within a c++ program on another unix machine?
Basically I have an X windows program that needs to open an
X Display that runs on another machine?
Thanks
0
Comment
Question by:soucy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 2

Expert Comment

by:mlev
ID: 1293460
I think your best bet would be system("rsh ...")
(or fork() + execlp("rsh", ...))
If you want to work harder, you might write a daemon
to run on the remote machine, wait for connection from
your program and then launch something.
0
 
LVL 3

Expert Comment

by:braveheart
ID: 1293461
mlev's suggestion looks good to me. Don't forget to use xhost appropriately to set permissions for the display on which the client will run.
0
 
LVL 1

Accepted Solution

by:
vulkanr earned 20 total points
ID: 1293462
if i understood your question correctly,
mlev is wrong. rsh will work on a workstation but if your
client is a X-TERM or a PC running some kind of X-emulator,
rsh is useless.
i suggest you "setenv" the DISPLAY enviroment variable to the
address of the remote machine client. (use putenv from within your program). then, every X program you will run will write
its output to the display of the remote machine.

0
Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

 
LVL 2

Expert Comment

by:mlev
ID: 1293463
vulkanr, read the question carefully: "...a program on a unix[!] machine from within a c++ program on another unix[!] machine."

0
 
LVL 1

Expert Comment

by:vulkanr
ID: 1293464
mlev, sure its a unix machine, but the problem described, is opening a display (A x-client), not running a remote program.

however, the answer i suggested would run over the local server.
i guess the right answer will be a combined one,
set the DISPLAY variable, then "rsh" to the remote server, and execute the desired program.

0
 
LVL 1

Expert Comment

by:vulkanr
ID: 1293465
mlev, sure its a unix machine, but the problem described, is opening a display (A x-client), not running a remote program.

however, the answer i suggested would run over the local server.
i guess the right answer will be a combined one,
set the DISPLAY variable, then "rsh" to the remote server, and execute the desired program.

0
 
LVL 2

Expert Comment

by:mlev
ID: 1293466
More like rsh to the remote server, set DISPLAY there, and execute it. Or execute it with -display option or whatever.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses
Course of the Month8 days, 9 hours left to enroll

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question