From owner-freebsd-stable@FreeBSD.ORG Thu May 24 22:30:18 2012 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 76E111065673 for ; Thu, 24 May 2012 22:30:18 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-we0-f182.google.com (mail-we0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id F28398FC08 for ; Thu, 24 May 2012 22:30:17 +0000 (UTC) Received: by werg1 with SMTP id g1so244958wer.13 for ; Thu, 24 May 2012 15:30:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=9N+B08E9IFqEBq3RseiOhbFjPVdmKr+7qqqUOLGdW1M=; b=Dq44x2oTpBbaTM41QYRCWMyxjYXxZz+yvbmGO0FipmbGfRhQ245QUkOMCkoCcNE1Vw aNZd07OwSa90c0jfBwxkCraUg1A9vafe2+VJa3zVpyqDeTaRDqNwCHlHDFO3ihf4pw1l 87xYcXYBq/GukUHKk7zIpNdmmmHfreouTbcGaO/YVXcf6W7HdhzT/OcRum/RkHmFiRZN Y2i+FBZ4C9I/Uaf0LRo3j3dvEGfZ82Oc8gNxS69IIPOGPAq9m3pFdWZkqjFHBpbYJq6r XOCr6VVnuz+Ygqb6gs+2IrXw3EqVKaDAyTmJRxJduqdEs926rXHbYSW88YLJsau7+aag idZw== Received: by 10.180.92.8 with SMTP id ci8mr58190568wib.15.1337898616938; Thu, 24 May 2012 15:30:16 -0700 (PDT) Received: from dft-labs.eu (dft-labs.eu. [80.87.128.179]) by mx.google.com with ESMTPS id fo7sm50523569wib.9.2012.05.24.15.30.15 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 24 May 2012 15:30:15 -0700 (PDT) Date: Fri, 25 May 2012 00:30:05 +0200 From: Mateusz Guzik To: Mike Jakubik Message-ID: <20120524223004.GC17579@dft-labs.eu> References: <1337887134.1908.20.camel@mike-PC> <20120524212219.GA17579@dft-labs.eu> <1337897210.1908.24.camel@mike-PC> <20120524221353.GB17579@dft-labs.eu> <1337898015.1908.27.camel@mike-PC> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1337898015.1908.27.camel@mike-PC> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: "freebsd-stable@freebsd.org" Subject: Re: Jail startup/shutdown broken on latest 9-STABLE 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, 24 May 2012 22:30:18 -0000 On Thu, May 24, 2012 at 06:20:15PM -0400, Mike Jakubik wrote: > On Fri, 2012-05-25 at 00:13 +0200, Mateusz Guzik wrote: > > On Thu, May 24, 2012 at 06:06:50PM -0400, Mike Jakubik wrote: > > > On Thu, 2012-05-24 at 23:22 +0200, Mateusz Guzik wrote: > > > > On Thu, May 24, 2012 at 03:18:54PM -0400, Mike Jakubik wrote: > > > > > Hello, > > > > > > > > > > Latest 9-STABLE has introduced some changes that break the ezjail rc > > > > > script. On bootup it fails to start, but when i log in via ssh and > > > > > manually start it, it works. However i am unable to shut them down > > > > > afterwards. > > > > > > > > > Try this: > > > > http://student.agh.edu.pl/~mjguzik/patches/jail-startup-shutdown.patch > > > > > > > > cd /usr/src && patch -p1 < patch && cd usr.sbin/jail && make && make install > > > > > > > > /usr/src/etc/rc.d/jail script can be just copied over. > > > > > > > > Note that your /var/run/jail_* files have broken content (some line from > > > > /etc/rc's output instead of jail id). > > > > > > > > > > Mateusz, > > > > > > Thanks for the patch, it fixes the startup issue on boot, however > > > shutting down the jails still does not work. The /var/run files have > > > garbage in them as you mentioned. > > > > > > root@jail.local:~# cat /var/run/jail_app.id > > > /etc/rc: WARNING: $hostname is not set -- see rc.conf(5). > > > > > > > > > Hostname is set in /etc/rc.conf. > > > > This message is about rc.conf from your jail. > > > > This should be fixed by my change to etc/rc.d/jail, are you sure that > > you are running patched version? > > > > Right, i just realized this. I set the hostname in the jailed rc.conf, > now the file contains this: > > root@jail.local:~# cat /var/run/jail_app.id > Setting hostname: app.local. > > I do not see a link to your jail rc.d script, just the patch. > > Patch contains two fixes, for both usr/sbin/jail and etc/rc.d/jail. Assuming that the patch is still applied to your source tree, just do: cp /usr/src/etc/rc.d/jail /etc/rc.d/jail This fixes the jail script to actually store jail id instead of messages from /etc/rc. That is, you should be able to stop jails started by new etc/rc.d/jail script. -- Mateusz Guzik