[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Need help in libssh - Need to send signal to process before closing channel.


Hello Sir,



We have a tool that periodically runs multiple commands on remote hosts
using libssh2 API’s. Now we are planning to move to the libssh library.

We created a utility by referring to the sample codes suggested in libssh
documentation. We are facing one issue while using the libssh library. Need
your expert advice on this.



On a few remote hosts ‘df’ command is not coming out due to mount points
having some issue. We are running the ‘df’ command from libssh client
utility on a remote host and expect that it should kill the process when we
close the channel. But this is not happening. We tried the all below API’s
provided by libssh but those are not working as per expectation.



ssh_channel_read_timeout()

ssh_channel_read_nonblocking()

ssh_channel_read ()



ssh_channel_request_send_break()

ssh_channel_request_send_signal()

ssh_channel_request_send_exit_signal()

ssh_channel_request_send_exit_status()





Below API is working but doesn’t know if it is the correct API to achieve
this. On a few remote hosts we observed “error: do_exec_pty: dup #2: Too
many open files” error message in /var/log/secure log file.
ssh_channel_request_pty()





We are running utilities from Windows and Linux OS. All remote hosts are
Linux servers for now.



I have attached the sample code. Please refer to the
show_remote_processes() function.

Thank you for your help in advance.



Thanks,

Pankaj

Attachment: libssh_client_run process_on_remote_host.cpp
Description: Binary data


Archive administrator: postmaster@lists.cynapses.org