From owner-freebsd-stable@FreeBSD.ORG Thu Jun 30 13:54:00 2005 Return-Path: X-Original-To: stable@freebsd.org Delivered-To: freebsd-stable@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A421616A41C; Thu, 30 Jun 2005 13:54:00 +0000 (GMT) (envelope-from eirik@unicore.no) Received: from anduin.net (anduin.net [212.12.46.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5E8B743D48; Thu, 30 Jun 2005 13:53:59 +0000 (GMT) (envelope-from eirik@unicore.no) Received: from eirik.unicore.no ([213.225.74.166] helo=[10.0.16.10]) by anduin.net with esmtpa (Exim 4.50 (FreeBSD)) id 1DnzUM-0003Vf-Gp; Thu, 30 Jun 2005 15:53:58 +0200 In-Reply-To: <20050629185803.GE1074@green.homeunix.org> References: <92135CB3-5540-4D06-A991-708C8AAD6AC7@unicore.no> <20050628145859.GC1074@green.homeunix.org> <20050629185803.GE1074@green.homeunix.org> Mime-Version: 1.0 (Apple Message framework v730) Content-Type: text/plain; charset=ISO-8859-1; delsp=yes; format=flowed Message-Id: <23ED6035-A1AE-4F38-853F-D0D42D42E934@unicore.no> Content-Transfer-Encoding: quoted-printable From: =?ISO-8859-1?Q?Eirik_=D8verby?= Date: Thu, 30 Jun 2005 15:53:56 +0200 To: Brian Fundakowski Feldman X-Mailer: Apple Mail (2.730) Cc: stable@freebsd.org Subject: Re: Jails that won't die... X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jun 2005 13:54:00 -0000 On 29. jun. 2005, at 20.58, Brian Fundakowski Feldman wrote: > On Wed, Jun 29, 2005 at 03:28:09PM +0200, Eirik =D8verby wrote: > >> >> On 28. jun. 2005, at 16.58, Brian Fundakowski Feldman wrote: >> >> >>> On Tue, Jun 28, 2005 at 10:37:29AM +0200, Eirik =D8verby wrote: >>> >>> >>>> Hi, >>>> >>>> I have, since upgrading to 5.x and updating my management tools, =20= >>>> seen >>>> a number of problems relating to stopping jails. >>>> >>>> I'm maintaining several hosts with a number of full-featured jails >>>> (i.e. full virtual FreeBSD installations in each jail), and in >>>> general this works fine. However, whenever I stop a jail using =20 >>>> 'jexec >>>> kill -SIGNAL -1' or 'jexec /bin/sh /etc/rc.shutdown' (in >>>> various combinations), jails have a tendency to stick around for >>>> minutes or hours - according to 'jls'. Often I see an entry in >>>> 'netstat -a' indicating that there is one or more sockets in =20 >>>> FIN_WAIT >>>> state, preventing the jail from coming down. Taking the virtual >>>> network interface (alias) down does not help. All I can do at this >>>> point is wait. >>>> >>>> I normally use 'jls' to determine whether or not a jail can be >>>> restarted (i.e. it's not running), but this is pretty useless in =20= >>>> such >>>> cases. And right now I have a case where 'netstat -a' shows me >>>> nothing pertaining to the jail, though it has no processes =20 >>>> running. I >>>> have therefore force-started the jail again, which seems to work >>>> nicely, but now 'jls' gives me two entries for this jail, with >>>> different JIDs. >>>> >>>> What am I doing wrong here? >>>> >>>> >>> >>> You could just use ps to check for jailed processes and check their >>> respective jails using the procfs status entry (at least according >>> to the ps manpage...) >>> >> >> My jailctl script can do both - list by jls and list by processes in >> the jail. There are NO processes running in the jail. >> > > So it's obviously not running, and you can mark its state as such. ...which is what I do on FreeBSD 4.x, but on 5.x the 'jls' command =20 still claims the jail is running. I think this is unbelieveably =20 dirty. Also, using /proc to determine if a jail is still running is a =20= bad idea, as mounting /proc is depreceated. /Eirik > > --=20 > Brian Fundakowski Feldman =20 > \'[ FreeBSD ]''''''''''\ > <> green@FreeBSD.org \ The Power =20 > to Serve! \ > Opinions expressed are my own. =20 > \,,,,,,,,,,,,,,,,,,,,,,\ > _______________________________________________ > freebsd-stable@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-stable > To unsubscribe, send any mail to "freebsd-stable-=20 > unsubscribe@freebsd.org" > > >