in reply to Re^9: Problem using Net::OpenSSH->capture to su to another user
in thread Problem using Net::OpenSSH->capture to su to another user

# io3 mloop, cin: 0, cout: 1, cerr: 0 # io3 fast, cin: 0, cout: 1, cerr: 0 # stdout, bytes read: 20 at offset 0 #> 45 78 69 74 20 72 65 71 75 65 73 74 20 73 65 6e 74 2e 0d 0a + | Exit request sent... # io3 fast, cin: 0, cout: 1, cerr: 0 # stdout, bytes read: 0 at offset 20 # leaving _io3() # _waitpid(19779) => pid: 19779, rc: # _kill_master: 19774 # waitpid(master: 19774) => pid: 19774, rc: # call args: ['ssh','-qtt','-S','/export/home/user/.libnet-openssh-per +l/user-mylinux-19767-362270','-l','user','mylinux0.qa.comp','--','ls +-l gLogs/*.log'] # open_ex: ['ssh','-qtt','-S','/export/home/user/.libnet-openssh-perl/ +user-mylinux-19767-362270','-l','user','mylinux0.qa.comp','--','ls -l + gLogs/*.log'] # io3 mloop, cin: 0, cout: 1, cerr: 1 # io3 fast, cin: 0, cout: 1, cerr: 1 # stdout, bytes read: 93 at offset 0 #> 2d 72 77 2d 72 2d 2d 72 2d 2d 20 31 20 66 6d 73 61 64 6d 36 30 20 6 +6 6d 73 20 31 30 35 30 32 20 | -rw-r--r-- 1 user usergrp 10502 #> 4a 75 6e 20 32 34 20 31 36 3a 32 37 20 2f 77 6f 72 6b 31 2f 64 36 2 +f 62 75 69 6c 64 73 2f 44 41 | Jun 24 16:27 #> 54 41 46 49 58 45 53 2f 4c 6f 67 73 2f 64 71 6c 5f 6f 75 74 70 75 7 +4 2e 6c 6f 67 0d 0a | /Logs/output.log.. # io3 fast, cin: 0, cout: 1, cerr: 1 # stdout, bytes read: 0 at offset 93 # stderr, bytes read: 0 # leaving _io3() # _waitpid(19780) => pid: 19780, rc: # DESTROY(Net::OpenSSH=HASH(0x285b710), pid: 19768) # killing master # sending exit control to master # call args: ['ssh','-O','exit','-T','-S','/export/home/user/.libnet-o +penssh-perl/user-mylinux-19767-463633','-l','user','mylinux0.qa.comp' +,'--'] # open_ex: ['ssh','-O','exit','-T','-S','/export/home/user/.libnet-ope +nssh-perl/user-mylinux-19767-463633','-l','user','mylinux0.qa.comp',' +--'] -rw-r--r-- 1 user usergrp 10502 Jun 24 16:27 Logs/output.log # io3 mloop, cin: 0, cout: 1, cerr: 0 # io3 fast, cin: 0, cout: 1, cerr: 0 # stdout, bytes read: 20 at offset 0 #> 45 78 69 74 20 72 65 71 75 65 73 74 20 73 65 6e 74 2e 0d 0a + | Exit request sent... # io3 fast, cin: 0, cout: 1, cerr: 0 # stdout, bytes read: 0 at offset 20 # leaving _io3() # _waitpid(19781) => pid: 19781, rc: # _kill_master: 19768 # waitpid(master: 19768) => pid: 0, rc: # waitpid(master: 19768) => pid: 19768, rc: Interrupted system call Killed by signal 1. # DESTROY(Net::OpenSSH=HASH(0x285c238), pid: 19777) # killing master # sending exit control to master # set_error(1 - control command failed: master ssh connection broken) # _kill_master: 19777 # waitpid(master: 19777) => pid: 0, rc: No such file or directory # waitpid(master: 19777) => pid: 19777, rc: Interrupted system call

Replies are listed 'Best First'.
Re^11: Problem using Net::OpenSSH->capture to su to another user
by salva (Canon) on Jun 28, 2014 at 07:34 UTC
    It seems you are not using the latest stable version of the module (0.62). Update it.

    Also, include the full debugging output, not just an excerpt.

      I tried with the 0.62 version and also got "Killed by signal 1.". Noticed that if a single command for system, capture or capture2, I don't get the error. But will get error when I run $ssh->system({tty=>1},@cmd) more than one time against same host. "Killed by signal 1." will happen on the last $ssh->system(@cmd) or capture(@cmd) or capture2(@cmd)
        It is difficult to see what's going wrong without the source code and the full debugging dump.
        I followed the examples in the synopsis and don't see the "Killed by signal 1" any more. Appreciate the responses.