ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gruenewald, Terry E" <tgrue...@sprintspectrum.com>
Subject RE: nohup not working with ant
Date Thu, 30 Jan 2003 17:25:36 GMT
Here's some sample code I have that involves sleep.ksh sleep.xml and
ksleep.ksh  sleep.ksh turns around and calls ant -f sleep.xml.  This xml
file has a single target which runs the ant sleep builtin task, and it
sleeps for 20 seconds.  When I run this like this:

nohup sleep.ksh &

and then log out of my session, I can see from another session that ant is
no longer running.  

However, my control which is ksleep.ksh just turns around and calls the unix
sleep program.  When I run this:

nohup ksleep.ksh &

and then log out of my session, I can see from another session that it is
still running (as expected.)  Does anyone have any thoughts as to why my ant
process doesn't appear to be surviving.  I've also tried this with java
programs, and they can survive the nohup logout combo.  

-Terry

ps.  here's the code:
/home/tgruen01>cat sleep.xml
<project name="nohuptest" default="build" basedir=".">
    <description>
        Used to figure out why ant doesn't like to run nohup in the
background. 
    </description>

    <target name="build">
       <sleep seconds="20"/>
    </target>
</project>

/home/tgruen01>cat sleep.ksh
#!/bin/ksh
ksh ant -f sleep.xml

/home/tgruen01>cat ksleep.ksh
#!/bin/ksh
sleep 10
/home/tgruen01>

-----Original Message-----
From: suu_quan@non.agilent.com [mailto:suu_quan@non.agilent.com] 
Sent: Thursday, January 30, 2003 11:10 AM
To: ant-user@jakarta.apache.org
Subject: RE: nohup not working with ant


	This is an OS and Shell combination problem. That's where you should
look at, not ant.

When your terminal window (or no window) starts ant, it starts ant as
'another process in the same process group'. When your terminal window dies,
some signal-I-forget gets propagated to all the processes in the 'process
group'.

'nohup' is supposed to detach your ant process from your terminal window's
'process group'.

Without nohup, your ant process will get the signal, and by default will
kill itself. With nohup, that signal is not propagated to your ant process,
which continues its course.

Check the behaviour of your OS and Shell combination.

Suu Quan
Configuration Management & Release Engineering
Agilent Technologies
Bldg 54, between Posts G4-G5 
5301 Stevens Creek Blvd
Santa Clara, CA 95051
> -----Original Message-----
> From: Gruenewald, Terry E [mailto:tgruen01@sprintspectrum.com]
> Sent: Thursday, January 30, 2003 8:57 AM
> To: Ant Users List
> Subject: RE: nohup not working with ant
> 
> 
> In my particular case, other Java processes start nohup just
> fine.  It is
> just ant for some reason that is not working.  I can't 
> imagine what it could
> be, or why ant would care about the presence or absence of 
> the terminal.
> 
> -----Original Message-----
> From: SimonRichardson2@hbosts.com
> [mailto:SimonRichardson2@hbosts.com] 
> Sent: Thursday, January 30, 2003 10:52 AM
> To: ant-user@jakarta.apache.org
> Subject: RE: nohup not working with ant
> 
> 
> We've seen similar problems when the Java processes are
> started using secure
> shell - may be a red herring?
> 
> > -----Original Message-----
> > From: Tiago Ferraz Machado [mailto:tferraz@cpqd.com.br]
> > Sent: 30 January 2003 16:38
> > To: Ant Users List
> > Subject: RES: nohup not working with ant
> > 
> > 
> > I had the sam eproblem running a JBoss process in nohup at a SunOS :
> > 
> > uname -sr
> > SunOS 5.6
> > 
> > Does anyone have a clue about this ??
> > 
> > []'s
> > 
> > Tiago.
> > 
> > -----Mensagem original-----
> > De: Gruenewald, Terry E [mailto:tgruen01@sprintspectrum.com]
> > Enviada em: quinta-feira, 30 de janeiro de 2003 14:26
> > Para: ant-user@jakarta.apache.org
> > Assunto: nohup not working with ant
> > 
> > 
> > When I run ant using nohup and in the background, it runs okay.  
> > However, if I then log out of my session, ant exits as well.  Has 
> > anyone run into this
> > before?  Does anyone know how to fix this so that the usual 
> > behavior of
> > nohup works.  

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

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


Mime
View raw message