Note that there are some explanatory texts on larger screens.

plurals
  1. PORemote SSH command execution hangs in ruby using Net::SSH for a particular command
    primarykey
    data
    text
    <p>I am trying to connect the remote ssh server via ruby using Net::SSH.It is working fine for me for all the commands provided via script and i could able to read the output of the command successfully. But when i use the below command it is getting stuck in SSH.exec!(cmd) and control is not returned from the line. Only if i click Ctrl+c in command line the script is getting ended. The command is ./wcsadmin.sh start --> this is used to start the processes of my application in remote server</p> <p>Please find the below code snippet of my ruby script:</p> <pre><code>Net::SSH.start(host, username, :password =&gt; password) do |ssh| puts 'before exit' output = ssh.exec!(/opt/wcsadmin.sh start) puts 'Executed command' </code></pre> <p>The output of the command when i do it manually is :</p> <blockquote> <p>[root@test bin]# ./wcsadmin.sh start</p> <p>Starting Network Control System...</p> <p>This may take a few minutes... stty: standard input: Invalid argument</p> <p>Network Control System started successfully.</p> <p>Starting SAM daemon... Done. Starting DA daemon... Starting DA syslog daemon... start</p> </blockquote> <p>if i use ssh.exec('./wcsadmin.sh start') the only difference is the above output is getting printed but still the program is never ended.I need to manually end it by hitting ctrl+c. When i searched in google i could find you can use </p> <blockquote> <p>nohup command('nohup /opt/wcsadmin.sh start >/tmp/teststartserver.log 2>&amp;1') </p> </blockquote> <p>to skip the hangup signals and tried the same.This also writes the output to teststartserver.log but getting hanged.Can anyone please help me out on this issue?</p> <p>Thanks in Advance!</p> <p>Thanks, Meena</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload