[
https://issues.apache.org/jira/browse/JCLOUDS-446?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13889061#comment-13889061
]
Everett Toews edited comment on JCLOUDS-446 at 2/2/14 9:15 PM:
---------------------------------------------------------------
I'm running my jclouds code like this.
{code}
RunScriptOptions options = RunScriptOptions.Builder
.blockOnComplete(true);
String script = new ScriptBuilder()
.addStatement(exec("sudo apt-get -q -y update"))
.render(OsFamily.UNIX);
computeService.runScriptOnNode(node.getId(), script, options);
{code}
But the ssh session ends part of the way through the update.
I've tried setting connection timeout to infinite but that didn't help.
{code}
Iterable<Module> modules = ImmutableSet.<Module> of(
new SLF4JLoggingModule(),
new SshjSshClientModule());
Properties overrides = new Properties();
overrides.setProperty(Constants.PROPERTY_CONNECTION_TIMEOUT, "0");
ComputeServiceContext context =
ContextBuilder.newBuilder("rackspace-cloudservers-us")
.credentials(rackspaceUsername, rackspaceApiKey)
.modules(modules)
.overrides(overrides)
.buildView(ComputeServiceContext.class);
{code}
But that didn't help. I'm going to keep digging tomorrow.
Let me know if you make any progress debugging.
was (Author: everett-toews):
I'm running my jclouds code like this.
{code}
RunScriptOptions options = RunScriptOptions.Builder
.blockOnComplete(true);
String script = new ScriptBuilder()
.addStatement(exec("sudo apt-get -q -y update"))
.render(OsFamily.UNIX);
computeService.runScriptOnNode(node.getId(), script, options);
{code}
But the ssh session ends part of the way through the update.
I've tried setting connection timeout to infinite but that didn't help.
{code}
Iterable<Module> modules = ImmutableSet.<Module> of(
new SLF4JLoggingModule(),
new SshjSshClientModule());
Properties overrides = new Properties();
overrides.setProperty(ComputeServiceProperties.POLL_INITIAL_PERIOD, "30000");
overrides.setProperty(ComputeServiceProperties.POLL_MAX_PERIOD, "30000");
overrides.setProperty(Constants.PROPERTY_CONNECTION_TIMEOUT, "0");
ComputeServiceContext context =
ContextBuilder.newBuilder("rackspace-cloudservers-us")
.credentials(rackspaceUsername, rackspaceApiKey)
.modules(modules)
.overrides(overrides)
.buildView(ComputeServiceContext.class);
{code}
But that didn't help. I'm going to keep digging tomorrow.
Let me know if you make any progress debugging.
> Script doesn't run
> -------------------
>
> Key: JCLOUDS-446
> URL: https://issues.apache.org/jira/browse/JCLOUDS-446
> Project: jclouds
> Issue Type: Bug
> Components: jclouds-compute
> Affects Versions: 1.7.0, 1.8.0
> Reporter: Izek Greenfield
>
> Hi,
> i have this script:
> `rm -rf /etc/puppet/prodpuppet
> cd /etc/puppet
> git clone http://10.234.0.72/prodpuppet /etc/puppet/prodpuppet
> for file in `find /etc/puppet/prodpuppet -iname *.sh`
> do
> chmod 700 $file
> done
> rm -rf /etc/puppet/chpuppet
> git clone http://10.234.0.72/chpuppet /etc/puppet/chpuppet
> for file in `find /etc/puppet/chpuppet -iname *.sh`
> do
> chmod 700 $file
> done
> cd -
> echo '
> class role::scopeBase {
> require bin_repo::client
> #require sysstat
> require set_env
> #require expect
> require admin::ssh_disable_host_key_check
> require admin::augeas
> require admin::log
> require admin::ntp
> require admin::yum
> }
> class role::scope inherits role::scopeBase {
> #####################
> # hostname izek-as-mongo0
> #####################
> include mongodb_tar
> include emm
> }' > /etc/puppet/chpuppet/modules/role/manifests/scope.pp
> echo
> '{"rpm::folder":"/opt/nds/rpms","mongodb_tar::version":"2.4.5.1","bin_repo::url":"http://10.234.0.72/dependencies","bin_repo::host":"10.234.0.72","emm::version":"3.51.0-2","bin_repo::dir":"/opt/nds/rpms","install_dir":"/opt/nds/installed/","bin_repo::components::url":"http://10.234.0.72/components"}'
> > /etc/puppet/chpuppet/hieradata/role/scope.json
> chmod 600 /etc/puppet/chpuppet/hieradata/role/scope.json
> augtool set /files/etc/puppet/puppet.conf/main/environment scope
> augtool set /files/etc/puppet/puppet.conf/main/modulepath
> /etc/puppet/modules:/usr/share/puppet/modules:/etc/puppet/prodpuppet/modules:/etc/puppet/chpuppet/modules:/etc/puppet/chpuppet/forge
> ln -s /etc/puppet/chpuppet/hieradata/hiera.yaml /etc/puppet/hiera.yaml
> ln -s /etc/puppet/chpuppet/hieradata /etc/hieradata
> cd /etc/puppet
> export FACTER_vmrole=scope; export FACTER_fqdn=com;
> /etc/puppet/chpuppet/provisioning/puppet/puppet_check.sh role::scope
> cd -`
> when running from java the git clone do nothing. when log into the machine
> and run the script it is OK.
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)