Control-c not working in rxvt (for exiting jboss server)

Igor Pechtchanski pechtcha@cs.nyu.edu
Sat Feb 28 22:06:00 GMT 2004


Chuck,

If you wish to get a clean shutdown, *do not* rely on Cygwin signals
unless you're sure that the program can handle them properly.  I suggest
looking at the Cygwin sources to find out exactly what a SIGINT gets
turned into for Windows processes.  Most likely it's doing exactly what
you inferred - a "TerminateProcess" (the Windows equivalent of "kill -9")
-- I don't have the sources handy to check right now.  Looking at the
parts of the output of "strace bash" dealing with signal delivery might
also prove instructive.

Or, as Dave mentioned, you can always use the 'trap' command to invoke the
JBoss shutdown script on SIGINT.
	Igor

On Sat, 28 Feb 2004, Chuck Irvine wrote:

> Dave,
>
> I tried changing the jboss startup script to use "/usr/bin/bash" instead
> of "/bin/sh" and that worked pretty well. When I hit control-c, the
> jboss server does shut down. However, the normal logging sent to
> standard out showing the progress of the shutdown does not come through.
> Not sure what to make of that - maybe it's doing a "kill -9"? Still,
> right now, I deem this an improvement.
>
> I'm a little hesitant to go to the latest snapshot since I rely on
> cygwin for many things. Do you think it is as safe as the current
> version?
>
> Jboss comes with a shutdown script. I just wanted the convenience of
> shutting down via control-c.
>
> Thanks for your help.
>
> Chuck
>
> > -----Original Message-----
> > From: David Rothenberger [mailto:daveroth@acm.org]
> > Sent: Saturday, February 28, 2004 12:41 PM
> > To: Chuck Irvine
> > Cc: cygwin@cygwin.com
> > Subject: Re: Control-c not working in rxvt (for exiting jboss server)
> >
> >
> > Chuck Irvine wrote:
> > > When I start Jboss server from rxvt, I cannot exit, that is, shutdown
> > > the server, using Control-c. If I start the server from the normal
> > > cygwin bash prompt, that is, cywin.bat, control-c shuts down the
> > > server. Control-c from rxvt in other contexts does seem to work, for
> > > example, if I invoke "ping -n 100 localhost" control-c does cause an
> > > exit. Cygcheck output attached. Thanks
> > >
> > > Chuck
> >
> > Chuck,
> >
> > I would start by trying the latest snapshot.  Cygwin 1.5.7 has some
> > problems with signal handling.
> >
> > If you start JBoss with a script, you could also try changing it from
> > /bin/sh to /bin/bash or vice versa, since I seem to recall
> > the two shells
> > handling signals differently in 1.5.7.  That might not be
> > true any longer,
> > though, with the latest ash.
> >
> > Finally, you can try to explicitly kill the Jboss (Java?)
> > process using
> > something like the following.
> >
> > ---------------------------
> > #!/bin/bash
> >
> > enTrapSIGINT () {
> >    kill $child_pid;
> >    exit;
> > }
> >
> > trap enTrapSIGINT 2
> >
> > startJboss &
> > child_pid = $!
> > wait
> > ----------------------------
> >
> > Dave

-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster."  -- Patrick Naughton

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list