Bug 181517 - [usability] Specify commands to be run before remote application launch
Summary: [usability] Specify commands to be run before remote application launch
Status: RESOLVED FIXED
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 3.1 M5   Edit
Assignee: Anna Dushistova CLA
QA Contact: Martin Oberhuber CLA
URL: http://www.eclipse.org/newsportal/art...
Whiteboard:
Keywords: bugday, helpwanted
Depends on:
Blocks:
 
Reported: 2007-04-08 07:28 EDT by Sander Klous CLA
Modified: 2009-01-19 10:48 EST (History)
7 users (show)

See Also:


Attachments
Mockup of modified remote C main tab (30.96 KB, image/png)
2008-12-22 11:41 EST, Anna Dushistova CLA
no flags Details
solution (12.94 KB, patch)
2009-01-01 14:13 EST, Anna Dushistova CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sander Klous CLA 2007-04-08 07:28:15 EDT
+++ This bug was initially created as a clone of Bug #181404 +++

I would like to be able to automatically execute a number of commands in the remote shell to setup the environment before my application is launched by CDT remote application launcher.

A thread with a detailed discussion on this topic is on the target management mailing list and starts here:

http://www.eclipse.org/newsportal/article.php?id=116&group=eclipse.dsdp.tm#116

Thanks,
Sander
Comment 1 Martin Oberhuber CLA 2007-04-10 09:59:41 EDT
This sounds like a nice enhancement request.
Comments?
Comment 2 David Dykstal CLA 2007-04-10 10:06:07 EDT
(In reply to comment #1)
> This sounds like a nice enhancement request.
> Comments?
> 

I agree. A good candidate for the next release.
Comment 3 David McKnight CLA 2007-04-10 10:31:19 EDT
This makes sense to me, especially for things like initializing an environment.
Comment 4 Martin Oberhuber CLA 2007-04-10 12:07:34 EDT
OK.

I think in the simplest case, this would be a single text box allowing to enter a single command to execute at the remote side at shell startup. This could then run a script to do more initializations (e.g. source myScript.sh).

Alternatively, a full editor could be opened to edit the script on the local side.

Preferences?
Comment 5 Sander Klous CLA 2007-04-11 14:34:41 EDT
I would prefer the simplest and most transparant implementation. Hence, a text box for one single command would do the job. In fact, I can not think of any realistic Use Case that would require more than that.
Thanks,
Sander

(In reply to comment #4)
> OK.
> I think in the simplest case, this would be a single text box allowing to
> enter a single command to execute at the remote side at shell startup. This
> could then run a script to do more initializations (e.g. source myScript.sh).
> Alternatively, a full editor could be opened to edit the script on the local
> side.
> Preferences?

Comment 6 Martin Oberhuber CLA 2007-04-11 15:52:49 EDT
Well,

the problem with a single command like "source envFile.sh" is that it will work only on those particular hosts where envFile.sh exists in a given place. Thus it is not easily team shareable.

We intend to foster team sharing of connections in RSE over time. Thus having the full script of commands to be executed managed by RSE persistence improves team sharing. The question is, is this necessary and do we need it for 2.0 or should we  go with a simple solution for now and enhance it for a more versatile UI after 2.0?
Comment 7 Sander Klous CLA 2007-04-16 05:42:37 EDT
The biggest advantage of the "single command solution" is the transparancy, i.e. it is obvious what the remote launcher will try to do and an error message like "envFile.sh not found" on the remote host is very clear.

Could you comment on how the "team shareable solution" would affect this transparancy?

Thanks,
Sander
Comment 8 Martin Oberhuber CLA 2007-06-01 06:31:28 EDT
Trying to get this done for RC2. FYI, a similar request to generalize this for all shells is tracked in bug #181402.
Comment 9 Martin Oberhuber CLA 2007-06-05 13:52:33 EDT
Will try for RC3
Comment 10 Martin Oberhuber CLA 2007-06-12 05:48:42 EDT
Not for 2.0 - sorry, ran out of time. Note though, that extenders can add this feature to their own variant of remotecdt launch easily.
Comment 11 Sander Klous CLA 2007-11-08 10:42:01 EST
(In reply to comment #10)
> Not for 2.0 - sorry, ran out of time. Note though, that extenders can add this
> feature to their own variant of remotecdt launch easily.
> 

Does this enhancement go into 3.0?
Thanks,
Sander
Comment 12 Hemang Lavana CLA 2008-01-12 10:22:04 EST
I need very similar capabilities for setting env variables but with slightly different use case. 

In my case, I need to add a different path value to LD_LIBRARY_PATH depending on which executable is getting invoked. This is to ensure that multiple versions of the same executable binary can be invoked but it doesn't load the incompatible version of its corresponding library. So I cannot add all the library paths for the various executable binaries in one shot.

One solution is to write a wrapper for each executable version as shown below:

#!/bin/sh
# foo-1.1
LD_LIBRARY_PATH="/usr/lib/foo1.1:$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH
exec foo-1.1 "$0" ${1+"$@"}

#!/bin/sh
# foo-1.2
LD_LIBRARY_PATH="/usr/lib/foo1.2:$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH
exec foo-1.2 "$0" ${1+"$@"}

However, this requires me to first create a wrapper, save it on the remote host in appropriate location and then invoke the wrapper instead of an executable.

On the other hand, if RSE provided a mechanism to set environment variables on the remote host which are valid for the context of command invocation only, it would be very useful.
Comment 13 Martin Oberhuber CLA 2008-05-20 17:54:06 EDT
I propose adding a single "Commands to execute before application" field to the RemoteCDT tab. 

This single command can then be a shellscript ("source foo.csh"), (". bar.sh") to perform all necessary steps.

The Launch Delegate should just take the contents of this additional field, and print it into the open Shell that it already has, just before it launches the application.

It sounds like a fairly simple but really useful enhancement request. Drasch could you have a look at this?
Comment 14 Anna Dushistova CLA 2008-12-22 11:41:14 EST
Created attachment 121082 [details]
Mockup of modified remote C main tab

Should it be a text field or text area?
What would you prefer?
Comment 15 Anna Dushistova CLA 2009-01-01 14:13:43 EST
Created attachment 121414 [details]
solution
Comment 16 Anna Dushistova CLA 2009-01-15 15:08:50 EST
Patch is checked in.

(In reply to comment #15)
> Created an attachment (id=121414) [details]
> solution