hi,
i try to excute a command using ChannelExec. After the session disconnect ,
the process of application still exist, and its parent proccess is changed
as init proccess.
i don't understand.
i am working with this:
-----------------------------------
JSch jsch=new JSch();
String host="10.6.148.4" ,
user = "hotel" ;
Session session=jsch.getSession(user, host, 22);
session.setPassword("hotel");
session.setConfig("StrictHostKeyChecking", "no");
session.connect(3000); // making a connection with timeout.
ChannelExec channel= (ChannelExec)(session.openChannel("exec"));
channel.setCommand("sh
/opt/app/appcode/2main/zqhtest/exceHello.sh");
channel.setOutputStream(System.out);
channel.connect();
Thread.sleep(2000);
channel.disconnect();
session.disconnect();
-------------------------------------
the process infomation before session disconnect like this:
root 8524 3406 0 10:35 ? ssgd: hotel [priv]
hotel 8526 8524 0 10:35 ? sshd: hotel@notty
hotel 8527 8526 0 10:35 ? sh /opt/app/excehello.sh
hotel 8544 8527 0 10:35 ? java -jar /opt/app/hello.jar
after session disconnect:
hotel 8527 1 0 10:35 ? sh /opt/app/excehello.sh
hotel 8544 8527 0 10:35 ? java -jar /opt/app/hello.jar
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and
their applications. This 200-page book is written by three acclaimed
leaders in the field. The early access version is available now.
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
_______________________________________________
JSch-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jsch-users