[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Remote Execution

Posted on 1998-09-29
7
Medium Priority
?
263 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
  • 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
Loops Section Overview

834 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