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 Date: Fri, 14 Oct 2005 15:43:07 -0400 From: Christopher Faylor 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 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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/