From owner-freebsd-jail@FreeBSD.ORG Sun Nov 9 05:34:04 2014 Return-Path: Delivered-To: freebsd-jail@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 320C2670 for ; Sun, 9 Nov 2014 05:34:04 +0000 (UTC) Received: from m2.gritton.org (gritton.org [63.246.134.121]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F162C640 for ; Sun, 9 Nov 2014 05:34:03 +0000 (UTC) Received: from m2.gritton.org (gritton.org [63.246.134.121]) by m2.gritton.org (8.14.9/8.14.9) with ESMTP id sA95DAKl001784; Sat, 8 Nov 2014 22:13:10 -0700 (MST) (envelope-from jamie@freebsd.org) Received: (from www@localhost) by m2.gritton.org (8.14.9/8.14.9/Submit) id sA95D9a5001783; Sat, 8 Nov 2014 22:13:09 -0700 (MST) (envelope-from jamie@freebsd.org) X-Authentication-Warning: gritton.org: www set sender to jamie@freebsd.org using -f To: freebsd-jail@freebsd.org Subject: Re: fails exec.postsop after shutdown jail. X-PHP-Originating-Script: 0:rcube.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Sat, 08 Nov 2014 22:13:09 -0700 From: James Gritton In-Reply-To: References: Message-ID: <294ef242e2fd3c13fbe9c1a9aa00e559@gritton.org> X-Sender: jamie@freebsd.org User-Agent: Roundcube Webmail/1.0.3 Cc: =?UTF-8?Q?=D0=91=D0=BE=D1=80=D0=B8=D1=81?= X-BeenThere: freebsd-jail@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "Discussion about FreeBSD jail\(8\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Nov 2014 05:34:04 -0000 On 2014-11-07 00:47, Борис wrote: > Hi, i use FreeBSD 10.1-RC4. > When i shutdown jail (jexec /bin/sh /etc/rc.shudown) exec.poststop > doesn't work and 1st string in my jail.conf (mount = "....) doesn't > automatically unmounted, but in "man jails" say's that mount will > unmount after removing jails. > my jail.conf: > > mount = "/usr/ports /jails/$name/usr/ports nullfs ro 0 > 0 "; > exec.start = "/bin/sh /etc/rc"; > exec.stop = "/bin/sh /etc/rc.shutdown"; > mount.devfs; > exec.clean; > allow.mount; > vnet = new; > path = "/jails/$name"; > allow.raw_sockets; > > testjail1 { > exec.prestart += "ifconfig epair0 create"; > exec.prestart += "ifconfig bridge0 addm epair0a"; > exec.prestart += "ifconfig epair0a up"; > vnet.interface = "epair0b"; > exec.start += "ifconfig epair0b 192.168.1.150/24"; > exec.start += "route add default 192.168.1.254"; > exec.poststop = "ifconfig epair0a destroy"; > } > > Or am I doing something wrong? Everything looks right to me. I've tried it out on my own system, and it worked as expected. The only difference is I don't have VIMAGE, so I commented out the vnet stuff (including the exec.start that goes along with it). So maybe the trouble is with vnet? Even still, that looks correct. I'm just able to test it at the moment. Regardless, vnet shouldn't affect the nullfs mount. What output do you get for "jail -vr testjail1"? - Jamie From owner-freebsd-jail@FreeBSD.ORG Sun Nov 9 08:45:02 2014 Return-Path: Delivered-To: freebsd-jail@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 577CAD29 for ; Sun, 9 Nov 2014 08:45:02 +0000 (UTC) Received: from frv197.fwdcdn.com (frv197.fwdcdn.com [212.42.77.197]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 178EDE38 for ; Sun, 9 Nov 2014 08:45:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ukr.net; s=ffe; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Cc:To:Subject:From:Date; bh=Sm7V9sN9GAxBCxNqNtkePzqQjUjWYkwPRikn3gpeErI=; b=mFCzqQ7JlaFfN6I5n0fTXnr4zpej1oWRpeWwHdezvvLIce/ap92Iej77fpeBzhIykciwk94vyB5FMSeYOcDRUCflL6luZ+NHXTEGsIgMuShzXIQwq/u1djzQF2pWKNJcaaqL920PWsysNqrKnieUMVkjoWqh/MngUi58XQHANEk=; Received: from [10.10.10.34] (helo=frv34.fwdcdn.com) by frv197.fwdcdn.com with smtp ID 1XnO77-000Bg8-Ao for freebsd-jail@freebsd.org; Sun, 09 Nov 2014 10:44:49 +0200 Date: Sun, 09 Nov 2014 10:44:49 +0200 From: wishmaster Subject: Re[2]: fails exec.postsop after shutdown jail. To: James Gritton X-Mailer: mail.ukr.net 5.0 Message-Id: <1415522364.331948284.b9pf4yjg@frv34.fwdcdn.com> In-Reply-To: <294ef242e2fd3c13fbe9c1a9aa00e559@gritton.org> References: <294ef242e2fd3c13fbe9c1a9aa00e559@gritton.org> MIME-Version: 1.0 Received: from artemrts@ukr.net by frv34.fwdcdn.com; Sun, 09 Nov 2014 10:44:49 +0200 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: binary Content-Disposition: inline Cc: freebsd-jail@freebsd.org X-BeenThere: freebsd-jail@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "Discussion about FreeBSD jail\(8\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Nov 2014 08:45:02 -0000 Hi, List, James. --- Original message --- From: "James Gritton" Date: 9 November 2014, 07:34:22 > On 2014-11-07 00:47, Борис wrote: > > Hi, i use FreeBSD 10.1-RC4. > > When i shutdown jail (jexec /bin/sh /etc/rc.shudown) exec.poststop > > doesn't work and 1st string in my jail.conf (mount = "....) doesn't > > automatically unmounted, but in "man jails" say's that mount will > > unmount after removing jails. > > my jail.conf: > > > > mount = "/usr/ports /jails/$name/usr/ports nullfs ro 0 > > 0 "; > > exec.start = "/bin/sh /etc/rc"; > > exec.stop = "/bin/sh /etc/rc.shutdown"; > > mount.devfs; > > exec.clean; > > allow.mount; > > vnet = new; > > path = "/jails/$name"; > > allow.raw_sockets; > > > > testjail1 { > > exec.prestart += "ifconfig epair0 create"; > > exec.prestart += "ifconfig bridge0 addm epair0a"; > > exec.prestart += "ifconfig epair0a up"; > > vnet.interface = "epair0b"; > > exec.start += "ifconfig epair0b 192.168.1.150/24"; > > exec.start += "route add default 192.168.1.254"; > > exec.poststop = "ifconfig epair0a destroy"; > > } > > > > Or am I doing something wrong? > > > Everything looks right to me. I've tried it out on my own system, and > it worked as expected. The only difference is I don't have VIMAGE, so > I commented out the vnet stuff (including the exec.start that goes > along with it). > > So maybe the trouble is with vnet? Even still, that looks correct. > I'm just able to test it at the moment. Regardless, vnet shouldn't > affect the nullfs mount. > > What output do you get for "jail -vr testjail1"? I have the same problem. The server has one jail with nginx and I use ram disk for fastcgi cache. /dev/md0 on /usr/home/jails/j2/var/tmp/nginx/fastcgi_cache (ufs, local, noatime, noexec, nosuid, nosymfollow) After stopping jail mount point is still present. I use VIMAGE too. May be need CC to freebsd-virtualization or freebsd-net as this issue might be vnet related? Cheers, Vitaliy From owner-freebsd-jail@FreeBSD.ORG Mon Nov 10 09:13:08 2014 Return-Path: Delivered-To: freebsd-jail@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 458DDF36 for ; Mon, 10 Nov 2014 09:13:08 +0000 (UTC) Received: from st15.mi6.kiev.ua (st15.mi6.kiev.ua [91.198.36.69]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EF5A83D1 for ; Mon, 10 Nov 2014 09:13:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=i.ua; s=mail; h=Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Date:From:Subject:To; bh=SWFhoI6yDT5CHPeImdGvU6H/x7v8AyQEhFbERHQWwfI=; b=ieypra0akVSliLLj4FEJXMw0fU8hhpw9AN8HWvTbm12Ia8d9s8qxjrtdRLKFDlUuewBetktFNQttA7vdJN2YgVUAzD3npTxQ3FBvRkr8yZ/ewJSrsIzQHF1qeZ7gwl/B3Fx6ExBoMEWOyZU6jGExFDRQubUzSjk+V7j5i1oJpUs=; Received: from st05.mi6 ([10.0.0.29] helo=st05.mi6.kiev.ua) by st15.mi6.kiev.ua with esmtp (Exim 4.80.1) (envelope-from ) id 1Xnl21-0001lc-2n for freebsd-jail@freebsd.org; Mon, 10 Nov 2014 11:13:05 +0200 Received: from web by st05.mi6.kiev.ua with local (Exim 4.80.1) (envelope-from ) id 1Xnl21-0008Gl-3d for freebsd-jail@freebsd.org; Mon, 10 Nov 2014 11:13:05 +0200 To: freebsd-jail@freebsd.org Subject: =?utf-8?B?RndkOiBSZVsyXTogZmFpbHMgZXhlYy5wb3N0c29wIGFmdGVyIHNodXRkb3duIGphaWwu?= From: =?utf-8?B?0JHQvtGA0LjRgQ==?= Date: Mon, 10 Nov 2014 11:13:05 +0200 MIME-Version: 1.0 X-Mailer: I.UA Mail System X-Server: st05.mi6.kiev.ua X-Sender-IP: 82.207.63.170 X-User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:33.0) Gecko/20100101 Firefox/33.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-Id: X-BeenThere: freebsd-jail@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "Discussion about FreeBSD jail\(8\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Nov 2014 09:13:08 -0000 > Everything looks right to me. I've tried it out on my own system, and > it worked as expected. The only difference is I don't have VIMAGE, so > I commented out the vnet stuff (including the exec.start that goes > along with it). > > So maybe the trouble is with vnet? Even still, that looks correct. > I'm just able to test it at the moment. Regardless, vnet shouldn't > affect the nullfs mount. > > What output do you get for "jail -vr testjail1"? > > - Jamie I do not understand anything, after booting my test stand to see output "jail -vr testjail1" all work's fine! root@:~ # jail -rv testjail1 testjail1: run command in jail: /bin/sh /etc/rc.shutdown Stopping cron. Waiting for PIDS: 4040. Stopping sshd. Waiting for PIDS: 4036. . Terminated testjail1: sent SIGTERM to: 3965 testjail1: removed testjail1: run command: ifconfig epair0a destroy testjail1: run command: /sbin/umount /jails/testjail1/dev testjail1: run command: /sbin/umount -t nullfs /jails/testjail1/usr/ports thank's for response, need more tests... -- реклама ----------------------------------------------------------- Регистрация домена .УКР со скидкой 150 грн.! Закажи красивое имя сейчас http://фрихост.укр/domain/ukr/ From owner-freebsd-jail@FreeBSD.ORG Tue Nov 11 21:56:23 2014 Return-Path: Delivered-To: freebsd-jail@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DD9DF88D for ; Tue, 11 Nov 2014 21:56:23 +0000 (UTC) Received: from m2.gritton.org (gritton.org [63.246.134.121]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A8618281 for ; Tue, 11 Nov 2014 21:56:23 +0000 (UTC) Received: from m2.gritton.org (gritton.org [63.246.134.121]) by m2.gritton.org (8.14.9/8.14.9) with ESMTP id sABLuExg039810; Tue, 11 Nov 2014 14:56:14 -0700 (MST) (envelope-from jamie@freebsd.org) Received: (from www@localhost) by m2.gritton.org (8.14.9/8.14.9/Submit) id sABLuDgc039809; Tue, 11 Nov 2014 14:56:13 -0700 (MST) (envelope-from jamie@freebsd.org) X-Authentication-Warning: gritton.org: www set sender to jamie@freebsd.org using -f To: freebsd-jail@freebsd.org Subject: Re: Fwd: Re[2]: fails exec.postsop after shutdown jail. X-PHP-Originating-Script: 0:rcube.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Tue, 11 Nov 2014 14:56:13 -0700 From: James Gritton In-Reply-To: References: Message-ID: <7c117eea78240220d57a9650161407f6@gritton.org> X-Sender: jamie@freebsd.org User-Agent: Roundcube Webmail/1.0.3 Cc: =?UTF-8?Q?=D0=91=D0=BE=D1=80=D0=B8=D1=81?= X-BeenThere: freebsd-jail@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "Discussion about FreeBSD jail\(8\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Nov 2014 21:56:24 -0000 On 2014-11-10 02:13, Борис wrote: >> Everything looks right to me. I've tried it out on my own system, and >> it worked as expected. The only difference is I don't have VIMAGE, so >> I commented out the vnet stuff (including the exec.start that goes >> along with it). >> >> So maybe the trouble is with vnet? Even still, that looks correct. >> I'm just able to test it at the moment. Regardless, vnet shouldn't >> affect the nullfs mount. >> >> What output do you get for "jail -vr testjail1"? >> >> - Jamie > I do not understand anything, after booting my test stand to see > output "jail -vr testjail1" all work's fine! > root@:~ # jail -rv testjail1 > testjail1: run command in jail: /bin/sh /etc/rc.shutdown > Stopping cron. > Waiting for PIDS: 4040. > Stopping sshd. > Waiting for PIDS: 4036. > . > Terminated > testjail1: sent SIGTERM to: 3965 > testjail1: removed > testjail1: run command: ifconfig epair0a destroy > testjail1: run command: /sbin/umount /jails/testjail1/dev > testjail1: run command: /sbin/umount -t nullfs > /jails/testjail1/usr/ports > > thank's for response, need more tests...subscribe@freebsd.org" OK, I've tried it with VIMAGE now, and with the relevant bits of the jail.conf included. It still all worked for me, creating the jail with the right IP address on epair0b, and removing both of the epairs when the jail was removed. So yeah, I guess it needs more tests - sorry I couldn't do anything to make sense of it. - Jamie