Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 20279 invoked from network); 5 Mar 2004 18:13:01 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 5 Mar 2004 18:13:01 -0000 Received: (qmail 10993 invoked by uid 500); 5 Mar 2004 18:12:44 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 10955 invoked by uid 500); 5 Mar 2004 18:12:44 -0000 Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list dev@ant.apache.org Received: (qmail 10916 invoked from network); 5 Mar 2004 18:12:43 -0000 Received: from unknown (HELO barrierb241.nike.com) (146.197.27.40) by daedalus.apache.org with SMTP; 5 Mar 2004 18:12:43 -0000 X-Server-Uuid: F122D6CD-24F0-4253-8986-549FB7942DF9 X-MimeOLE: Produced By Microsoft Exchange V6.0.6487.1 content-class: urn:content-classes:message MIME-Version: 1.0 Subject: RE: Sshexec fail on starting a service (websphere) Date: Fri, 5 Mar 2004 10:12:36 -0800 Message-ID: <200403051812.i25ICKOU016041@barrierb241.nike.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Sshexec fail on starting a service (websphere) Thread-Index: AcQCmrNzVRMVg0ofTEWZFe2YMwgw9QAQQDQg From: "Anderson, Rob (Global Trade)" To: "Ant Developers List" X-OriginalArrivalTime: 05 Mar 2004 18:12:36.0869 (UTC) FILETIME=[70525B50:01C402DD] X-WSS-ID: 6C561C9E16421-01-01 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N > -----Original Message----- > From: Steve Loughran [mailto:steve_l@iseran.com] > Sent: Friday, March 05, 2004 2:11 AM > To: Ant Developers List > Subject: Re: Sshexec fail on starting a service (websphere) >=20 >=20 > Anderson, Rob (Global Trade) wrote: > > The sshexec task, jsch and ssh cannot be expected to=20 > anylize the output from a command that is run. This is why=20 > there is an exit status. The example of echo is a good one.=20 > Echo will succeed and report exit status 0 to the process=20 > that calls it. If you wish to anylize the output of echo, you=20 > need to do this in the parent process. >=20 >=20 > While I agree with everything you say, the limited scope of=20 > exit codes=20 > really irritates me. >=20 > all we have to return errors and success is a number, a=20 > number that can=20 > also be used in different ways by java.exe, and which behaves=20 > differently on different boxes. >=20 > This code snippet from the LGPL smartfrog tasks=20 > (smartfrog.org) show the=20 > problem. I am forking java, but java.exe can return things if=20 > it feels=20 > like it, so the program we fork knows to return -1 for an error -the=20 > switch statement should say 0=3D=3Dgood, -1 error, else: trouble. >=20 > Only java1.4.2 on hpux seems to return 255 instead of -1 on=20 > exec. I can=20 > see a bit of platform specific details creeping in there, and=20 > it makes=20 > me unhappy. >=20 > switch(err) { > case 0: > return; > //-1 is an expected error, but > //for some reason smartfrog on HP-UX returns=20 > something=20 > else. > //so we catch 255 as well. > case -1: > case 255: > throw new BuildException(failureText); > default: > throw new BuildException(errorText+" - error=20 > code "+err); > } >=20 >=20 > Can we ever move to a world where executed programs throw a full=20 > exception up to the caller, rather than just return a status code? The decision to return a status code was probably made before I was = born. If there were a machine that ran Java as it's OS, rather than a = java vm on top of solaris/linux/hpux/windows/etc, we could have such an = environment where exceptions could be thrown to the parent process. -Rob Anderson >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org > For additional commands, e-mail: dev-help@ant.apache.org >=20 >=20 >=20 --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org