You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Chris Wood <ch...@thesprocket.org> on 2003/11/03 17:50:15 UTC

exec and shell scripts

Hi all,

I want to use an ant script to call a shell script on a Unix platform
(doesn't seem to matter which - we use Linux, Solaris and AIX and have
the same problem on all).

The problem I have is that the shell script is actually a script in one
of the rc directories - in other words it starts a daemon on the
machine.
When I run the shell script from a shell on the machine it starts the
daemon as a new process and then returns to the command prompt.

If I try to run the same script in ant 1.5.1 using exec, then the exec
never returns. If I do a Ctrl-C after a few seconds then the ant script
terminates and my daemon has started. This isn't pretty tho - It'd be
really useful for me if the exec returned.

I've come across similar looking issues on Unixes before - you start a
process in a remote shell, and when you try and close the shell it hangs
as you still have a running process. This doesn't often seem to happen
to me with daemon start scripts tho.

Does anyone know if this is the same problem?
Anyone got any ideas how to get round it?

Cheers,

Chris


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: exec and shell scripts

Posted by Mike Castle <da...@ix.netcom.com>.
In article <10...@ssdev30>,
Chris Wood  <us...@ant.apache.org> wrote:
>
>I've come across similar looking issues on Unixes before - you start a
>process in a remote shell, and when you try and close the shell it hangs
>as you still have a running process. This doesn't often seem to happen
>to me with daemon start scripts tho.

Does it happen with this particular daemon?

>Does anyone know if this is the same problem?

Daemon isn't closing stdin/stdout/stderr.

>Anyone got any ideas how to get round it?

Fix the daemon or try making use of the nohup command.

mrc
-- 
     Mike Castle      dalgoda@ix.netcom.com      www.netcom.com/~dalgoda/
    We are all of us living in the shadow of Manhattan.  -- Watchmen
fatal ("You are in a maze of twisty compiler features, all different"); -- gcc

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org