Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com X-Authentication-Warning: eos.vss.fsi.com: ford owned process doing -bs Date: Fri, 5 Dec 2003 18:00:00 -0600 (CST) From: Brian Ford X-X-Sender: ford AT eos To: Frank Seesink cc: cygwin AT cygwin DOT com Subject: Re: Cygrunsrv and spawned processes In-Reply-To: Message-ID: References: <20031205104953 DOT GA2456 AT cygbert DOT vinschen DOT de> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-559023410-1635412528-1070668800=:28297" ---559023410-1635412528-1070668800=:28297 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 * 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 ---559023410-1635412528-1070668800=:28297 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="cygrunsrv.cc.patch" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename="cygrunsrv.cc.patch" LS0tIGN5Z3J1bnNydi5jYwkyMDAzLTEyLTA1IDE3OjQ4OjI2LjI1MDAwMDAw MCAtMDYwMA0KKysrIGN5Z3J1bnNydi5jYy5vcmlnCTIwMDMtMTItMDUgMTc6 NDg6MTMuNTIwMDAwMDAwIC0wNjAwDQpAQCAtOTc4LDcgKzk3OCw3IEBAIHRl cm1pbmF0ZV9jaGlsZCAoKQ0KICAgICAgIHNsZWVwICgxKTsNCiAgICAgZWxz ZQ0KICAgICAgIHsNCi0Ja2lsbCAoLXNlcnZlcl9waWQsIHRlcm1zaWcpOw0K KwlraWxsIChzZXJ2ZXJfcGlkLCB0ZXJtc2lnKTsNCiAJcmVwb3J0X3NlcnZp Y2Vfc3RhdHVzICgpOw0KIAlyZXR1cm4gMDsNCiAgICAgICB9DQo= ---559023410-1635412528-1070668800=:28297 Content-Type: text/plain; charset=us-ascii -- 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/ ---559023410-1635412528-1070668800=:28297--