delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/10/14/15:43:16

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Fri, 14 Oct 2005 15:43:07 -0400
From: Christopher Faylor <cgf-no-personal-reply-please AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Sleep not terminating
Message-ID: <20051014194307.GA15972@trixie.casa.cgf.cx>
Reply-To: cygwin AT cygwin DOT com
References: <435008D7 DOT 7060903 AT acm DOT org>
Mime-Version: 1.0
In-Reply-To: <435008D7.7060903@acm.org>
User-Agent: Mutt/1.5.8i

On Fri, Oct 14, 2005 at 12:36:55PM -0700, David Rothenberger wrote:
>I'm encountering a weird problem with sleep.
>
>If I run
>
>$ while true; do sleep 120; done &
>[1] 6780
>$ kill %1
>
>the bash process (6780) and its child sleep process are both killed.
>
>However, if I kill the bash process using the pid, the child sleep 
>process is not killed.
>
>$ while true; do sleep 120; done &
>[1] 5528
>$ kill 5528
>$ ps -ef | grep sleep
>  drothe    6532       1   0  12:26:41 /bin/sleep
>
>I guess this problem has been around for a while. I'm seeing it with the 
>latest snapshot and also with 1.5.18, with the latest bash and the test 
>bash.

I don't suppose that you tried this on linux, did you?  Same behavior.

It's what I'd expect.  In the first case, by specifying "%1", you're
killing the process group, which consists of the bash process and the
sleep process.  In the second case, by specifying the bash pid, you're
killing only the bash process.  Since bash apparently doesn't have any
special "kill my subprocess" behavior, I wouldn't expect sleep to go
away.

cgf

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019