RE: Issue with ant shell sub-task
"Lee David Painter" <[email protected]>
| Newsgroups | gmane.comp.java.sshtools.user |
|---|---|
| Message-ID | <[email protected]> |
Mark, Have you tried the free Maverick ANT task; it has a v.similar interface and is based on the commercial J2SSH Maverick API? Lee -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of [email protected] Sent: 25 May 2004 19:04 To: [email protected] Subject: [Sshtools-users] Issue with ant shell sub-task I have the following ant test script: <project name="transport" default="testshell"> <taskdef name="ssh" classname="com.sshtools.ant.Ssh" /> <property environment="ENV"/> <property name="machine" value="wigtest4"/> <property name="pnc.build.users.admin_id" value="pp08920"/> <property name="pnc.build.key.location" value="${ENV.PRIVATE_KEY}"/> <property name="shell.prompt.web" value="DEP%"/> <property name="remote.dir" value="/app/cmk"/> <property name="ant.log.dir" value="/var/tmp/pp08920"/> <target name="testshell" description="test the ssh shell command"> <ssh host="${machine}" verifyhost="no" username=" ${pnc.build.users.admin_id}" keyfile="${pnc.build.key.location}"> <shell term="vt100"> <write>export PS1=${shell.prompt.web}</write> <write>cd ${remote.dir}</write> <read>${shell.prompt.web}</read> <write>pwd</write> <read>${shell.prompt.web}</read> <write>which ant</write> <read>${shell.prompt.web}</read> <write>echo SUCCESSFUL >> ant.log</write> <read>${shell.prompt.web}</read> <write>for i in a b c d e f g h i ;do echo $i; sleep 1 ;done</write> <read>${shell.prompt.web}</read> <write>tail ${ant.log.dir}/ant.log</write> <read timeout="5000">SUCCESSFUL</read> <write>mv ${ant.log.dir}/ant.log ${ant.log.dir}/ant.web.log</write> <read>${shell.prompt.web}</read> <write>exit</write> </shell> </ssh> </target> </project> when I run it on windowsXP box going to a RedHad Enterprise v3 update 2 I get the following: [ssh] INFO: Starting ssh-connection service thread [ssh] May 25, 2004 1:57:22 PM com.sshtools.j2ssh.connection.ConnectionProt ocol openChannel [ssh] INFO: Channel 0 is open [session] [ssh] May 25, 2004 1:57:22 PM com.sshtools.j2ssh.session.SessionChannelCli ent requestPseudoTerminal [ssh] INFO: Requesting pseudo terminal [ssh] export PS1=DEP% [ssh] cd /app/cmk [ssh] Last login: Tue May 25 13:42:11 2004 from fw-wireless-virtual-i.pncb ank.com [ssh] export PS1=DEP% [ssh] cd /app/cmk [ssh] -bash-2.05b$ export PS1=DEP% [ssh] DEP%cd /app/cmk [ssh] DEP% [ssh] pwd [ssh] which ant [ssh] echo SUCCESSFUL >> ant.log [ssh] for i in a b c d e f g h i ;do echo $i; sleep 1 ;done [ssh] wd [ssh] /app/cmk [ssh] DEP% [ssh] tail /var/tmp/pp08920/ant.log [ssh] which an [ssh] [ssh] echo SUCCESSFUL >> ant.log/usr/bin/ant [ssh] [ssh] DEP%echo SUCCESSF [ssh] mv /var/tmp/pp08920/ant.log /var/tmp/pp08920/ant.web.log [ssh] exit [ssh] Disconnecting from wigtest4 [ssh] May 25, 2004 1:57:23 PM com.sshtools.j2ssh.connection.ConnectionProt ocol onStop [ssh] INFO: Closing all active channels [ssh] May 25, 2004 1:57:23 PM com.sshtools.j2ssh.connection.Channel close [ssh] INFO: Finializing channel close [ssh] May 25, 2004 1:57:23 PM com.sshtools.j2ssh.connection.ChannelInputSt ream close [ssh] INFO: Closing ChannelInputStream [ssh] May 25, 2004 1:57:23 PM com.sshtools.j2ssh.connection.ChannelOutputS tream close [ssh] INFO: Closing ChannelOutputStream [ssh] May 25, 2004 1:57:23 PM com.sshtools.j2ssh.connection.ChannelInputSt ream close [ssh] INFO: Closing ChannelInputStream [ssh] May 25, 2004 1:57:23 PM com.sshtools.j2ssh.connection.ConnectionProt ocol freeChannel [ssh] INFO: Freeing channel 0 [session] BUILD SUCCESSFUL Total time: 4 seconds May 25, 2004 1:57:23 PM com.sshtools.j2ssh.transport.AsyncService run INFO: ssh-connection thread is exiting My issue is it only takes 4 seconds to run and it should take atleast 10. Also if you look at the output generated it should look like this: a b c d e f g h i I don't see any of the out put before the command exits. It looks like the reads are not waiting for the command to complete. any input on this would be appricated. I am using sshtools version 0.2.7 and 1.6.0 binary Mark Russell PNC 412-768-9603 ----------------------------------------- The contents of this email are the property of PNC. If it was not addressed to you, you have no legal right to read it. If you think you received it in error, please notify the sender. Do not forward or copy without permission of the sender. ------------------------------------------------------- This SF.Net email is sponsored by: Oracle 10g Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click _______________________________________________ Sshtools-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/sshtools-users ------------------------------------------------------- This SF.Net email is sponsored by: Oracle 10g Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click