This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Cygrunsrv and spawned processes


On Fri, 5 Dec 2003, Frank Seesink wrote:
> Corinna Vinschen wrote:
> > Cygrunsrv has no idea about child processes
> > started from it's inferior process.  It's the responsibility of that
> > process to care for its children.  This is different from the situation
> > in the shell where a Ctrl-C results in a SIGINT sent to all processes
> > not detached from the console.  A process started with spawn(_P_NOWAIT)
> > is not detached from the console.
> >
> BINGO!  This is EXACTLY the reason then.  So my statement stands.  There
> most definitely IS a difference between running a Cygwin app under a
> shell vs. via cygrunsrv.  And you just pointed it out.
>
> This is what I wanted to know.  Now the question is, is there any way to
> get similar behavior to what you get with a shell like BASH?  I've tried
> having cygrunsrv run a shell within which to launch Jabberd, but all I
> end up is the shell dying and BOTH jabberd.exe and jabadns.exe left
> behind.  So I'm guessing that sending a SIGINT from cygrunsrv to a BASH
> shell is also different than doing it manually, as it does not propogate
> (or whatever technical term you wish to throw at it).  The BASH shell
> does NOT react the same way under cygrunsrv as it does normally.
>
Actually, it does.  What you did was send the bash process a signal.  If
you did that "normally", you would see the same behavior.  However, you
sent the signal via a key stroke interpreted by bash.  That is the difference.

> I realize one way is to modify the source to have the main process kill
> the child, but that's a bit of code change.
>
> I was wondering, how hard would it be to have cygrunsrv provide the same
> functionality as a full shell?  That is, this issue does not occur under
> Linux, even when Jabberd is run as a daemon on startup, so it's
> definitely a Cygwin/cygrunsrv-specific issue.  Are there any plans to
> offer such functionality?  Just curious.
>
What do you define as the equivalent of "net stop jaberd" on Linux?

Anyway, the attached patch to cygrunsrv seems like a good idea and should
accomplish this, I think.

2003-12-05  Brian Ford  <ford@vss.fsi.com>

	* cygrunsrv.cc (terminate_child): Send the signal to the whole
	processes group.

-- 
Brian Ford
Senior Realtime Software Engineer
VITAL - Visual Simulation Systems
FlightSafety International
Phone: 314-551-8460
Fax:   314-551-8444

Attachment: cygrunsrv.cc.patch
Description: Text document

--
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/

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]