Re: [JSch-users] ChannelExec: clean-up or how to kill processes
Status: Alpha
Brought to you by:
ymnk
From: Daniel F. F. <dan...@te...> - 2007-02-20 16:42:32
|
Hi Norbert, I was dealing with a similar problem. In order to not rely on ssh signals, instead of using the channel to run the application, I send a pair or bash commands: the first prints the PID (of the bash), the second execs the application (and takes over bash's PID). Now there is an extra work of parsing the first output line as the PID number of the remote process. If I want to kill, then I open a second channel which calls then kill command line with the apropriate PID. Best regards, Daniel Felix Ferber Norbert Podhorszki escreveu: > Hi, > > Do you know any way to kill the remote process started by using > ChannelExec? Or just to get the process id of that process (talking about > unix here)? > > I have experienced that programs can just hang instead of nicely > performing an abort ;-), so I need to use a timeout for a > command execution (do not mix this with connection related timeout). > Just disconnecting the channel, however, does not kill the remote process, > which becomes really annoying after several such actions. > > Therefore, I would like to send a kill command for that process. > Does the ssh protocol say anything about this, or do I have to find an > ad-hoc solution? > > Thanks > Norbert > > Norbert Podhorszki > ------------------------------------ > University of California, Davis > Department of Computer Science > 1 Shields Ave, 2236 Kemper Hall > Davis, CA 95616 > (530) 754-8188 > pno...@cs... > ---------------------------------- > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > JSch-users mailing list > JSc...@li... > https://lists.sourceforge.net/lists/listinfo/jsch-users > > Esta mensagem foi verificada pelo E-mail Protegido Terra. > Scan engine: McAfee VirusScan / Atualizado em 19/02/2007 / Versão: 5.1.00/4966 > Proteja o seu e-mail Terra: http://mail.terra.com.br/ > |