[Swift-devel] command line ssh provider...

Mihael Hategan hategan at mcs.anl.gov
Tue Jan 17 16:44:24 CST 2012


That seems to be a limitation of Runtime.exec(). If you don't supply and
env array, the subprocess inherits the environment from the parent. If
you do, it overrides it (including unsetting the unspecified variables).

Traditionally, this was the only way of starting a subprocess. Starting
with 1.5, ProcessBuilder was added, which offers a solution to this
problem. I will change the code to use that.

On Tue, 2012-01-17 at 13:49 -0600, Jonathan Monette wrote:
> Ok.  Mike gave some suggestions and got it working.  I have the line <profile namespace="env" key="SWIFT_GEN_SCRIPTS">1</profile>.  Apparently, if any env variables are set in the sites file, other env's are overwritten.  Once this line is removed, the normal env variables are kept.  This is why the sshcl couldn't fine the agent because the variables that pointed to it was removed.  I am filing a bugzilla ticket for this env issue as I do not think this is the desired behavior.
> 
> On Jan 17, 2012, at 12:48 PM, Mihael Hategan wrote:
> 
> > On Tue, 2012-01-17 at 11:33 -0600, Jonathan Monette wrote:
> >> I am assuming that I have to get the sshcl provider to fail again for
> >> the stdout/stderr to be recorded?
> > 
> > Yes!
> > 
> >>  I typed the correct password in and this is what showed up:
> >> 
> >> 2-01-17 11:25:16,375-0600 DEBUG JobSubmissionTaskHandler Job: 
> >> 	executable: /bin/bash
> >> 	arguments:  /home/jonmon/Workspace/Swift/swift.workdir/hostname-20120117-1125-ora1c4k1/shared/_swiftwrap hostname-km209rlk -jobdir k -scratch  -e /bin/hostname -out hostname.txt -err stderr.txt -i -d  -if  -of hostname.txt -k  -cdmfile  -status provider -a
> >> 	stdout:     null
> >> 	stderr:     null
> >> 	directory:  /home/jonmon/Workspace/Swift/swift.workdir/hostname-20120117-1125-ora1c4k1
> >> 	batch:      false
> >> 	redirected: false
> >> 	attributes: null
> >> 	env:        SWIFT_GEN_SCRIPTS=1
> >> 
> >> This is what shows up in ps:
> >> jonmon   19162  0.0  0.0  59456  3344 pts/0    S+   11:25   0:00 ssh -v bridled.ci.uchicago.edu /bin/bash -s
> >> 
> >> so -v is being used in the ssh command but Swift isn't recording the output.
> > 
> > Right. Only in the case of failure is it logged.
> > 
> >> 
> >> I have also tried entering in the wrong password but Swift just keeps
> >> asking for the password until I type the correct one in.
> > 
> > It's not swift asking for the password, but ssh. You have to mistype it
> > enough times so that ssh will fail.
> > 
> >> 
> >> I see in the JobSubmissionTaskHandler file there is a way to specify a
> >> username.  In the sites file I use the line: <execution
> >> provider="ssh-cl" username="jonmon" url="bridled.ci.uchicago.edu"/>
> > 
> > Yeah, I'll remove that. Use ~/.ssh/config instead.
> > 
> >> 
> >> but the username is not used, I do not see the -l in the command line of the sshcl provider.  I wanted to try providing a username to the ssh command to see if that some how made it realize to use the agent set up for the user jonmon.
> >> 
> > 
> > 
> 





More information about the Swift-devel mailing list