Hi Kevan,

The attached diff works for me, while still doing the 'stty echo' the exit status of the Java command is preserved, so my script calling deploy.sh would still fail when Java fails, but not when stty fails.

BTW why not do 'stty sane' (or both), as apparently exiting Java with an exception does not reset the terminal properly ?

Regards,
Kees


-------- Original Message --------
Subject: Re: deploy.sh stty echo
From: Kevan Miller <[email protected]>
To: [email protected]
Date: Sat 13 Feb 2010 06:25:34 PM CET

On Feb 4, 2010, at 4:18 AM, Kees van Veen wrote:

Hi,

I just switched to geronimo-tomcat6-javaee5-2.2, and deploying our application 
with a script that calls $GERONIMO_HOME/bin/deploy.sh now fails (on Ubuntu 
9.10) because the last line in deploy.sh is 'stty echo' which causes the script 
to exit with a non-zero status (stty: standard input: Invalid argument) when 
input/output is redirected. Removing that line solves my problem.

Anyone else experiencing that ?

No, but sounds like we've introduced a problem.

FYI, this change was added to address -- 
https://issues.apache.org/jira/browse/GERONIMO-4589

Perhaps you have a suggestion for a better ways of handling? Afraid my 
scripting-foo is weak.

You should creat a Jira.

--kevan

--- deploy.sh_orig	2010-02-15 16:19:46.000000000 +0100
+++ deploy.sh	2010-02-15 16:20:59.000000000 +0100
@@ -186,4 +186,10 @@
   -Djava.io.tmpdir="$GERONIMO_TMPDIR" \
   -jar "$GERONIMO_HOME"/bin/deployer.jar "$@" 
 
-stty echo
+# Remember the exit code
+status=$?
+
+# Reset tty
+stty echo 2>/dev/null
+
+exit $status

Reply via email to