X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-0.2 required=5.0	tests=AWL,BAYES_00,RCVD_NUMERIC_HELO,SPF_HELO_PASS,T_RP_MATCHES_RCVD
X-Spam-Check-By: sourceware.org
To: cygwin@cygwin.com
From: SZABO Gergely <gergely.szabo@knorr-bremse.com>
Subject: Re: R: Why mc start without subshell by default?
Date: Wed, 3 Nov 2010 12:45:39 +0000 (UTC)
Lines: 36
Message-ID: <loom.20101103T133646-827@post.gmane.org>
References: <iar8kd$8u7$1@dough.gmane.org> <250110.4409.qm@web25507.mail.ukl.yahoo.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
User-Agent: Loom/3.14 (http://gmane.org/)
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

Marco Atzeri <marco_atzeri <at> yahoo.it> writes:

> 
> --- Mer 3/11/10, Oleksandr Gavenko  ha scritto:
> 
> > I can turn on subshell by:
> > 
> >   $ mc -U
> > 
> > This is useful by default or I miss something?
> > 
> > 
> 
> It is useful but there is one problem on cygwin.
> When you close mc the subshell will not exit, so you will finish
> with a "zombie" bash shell running.
> 
> Marco
> 
> 

I thought mc's lacking subshell support is a hard fact of life in Cygwin, until
the -U option was pointed out here. It's a huge improvement.

It's quite easy to kill the zombie subshells.
Put a line into /etc/crontab (assuming you're running cron):

*/6 * * * * SYSTEM ps -a | sed -n 's/I  *\([0-9][0-9]*\)  *1  *..*bash$/\1/p' |
xargs kill -KILL

This will kill all bash processes every 6 minutes, who are waiting for input in
the background (I) and whose parent process (PPID) is 1 (not a terminal, not mc).

Best regards
Gergely



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

