From owner-freebsd-jail@freebsd.org Wed Oct 12 00:46:27 2016 Return-Path: Delivered-To: freebsd-jail@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61A17C0ECDA for ; Wed, 12 Oct 2016 00:46:27 +0000 (UTC) (envelope-from 000.fbsd@quip.cz) Received: from elsa.codelab.cz (elsa.codelab.cz [94.124.105.4]) (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 25FF31A9; Wed, 12 Oct 2016 00:46:26 +0000 (UTC) (envelope-from 000.fbsd@quip.cz) Received: from elsa.codelab.cz (localhost [127.0.0.1]) by elsa.codelab.cz (Postfix) with ESMTP id 4D11B28474; Wed, 12 Oct 2016 02:46:18 +0200 (CEST) Received: from illbsd.quip.test (ip-86-49-16-209.net.upcbroadband.cz [86.49.16.209]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by elsa.codelab.cz (Postfix) with ESMTPSA id 6E9AA28435; Wed, 12 Oct 2016 02:46:17 +0200 (CEST) Subject: Re: some (random) jails are not started after reboot To: James Gritton , freebsd-jail@freebsd.org References: <57F63D18.1060701@quip.cz> <7c2f0434326257c5d2cbbb97a5c5e787@gritton.org> From: Miroslav Lachman <000.fbsd@quip.cz> Message-ID: <57FD87D9.4050209@quip.cz> Date: Wed, 12 Oct 2016 02:46:17 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:42.0) Gecko/20100101 Firefox/42.0 SeaMonkey/2.39 MIME-Version: 1.0 In-Reply-To: <7c2f0434326257c5d2cbbb97a5c5e787@gritton.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-jail@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Discussion about FreeBSD jail\(8\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2016 00:46:27 -0000 James Gritton wrote on 2016/10/06 18:11: > On 2016-10-06 06:01, Miroslav Lachman wrote: [...] >> This is production machine so I can't play with it too much. But does >> anybody else seen it too? >> How can I debug it on next reboot? > > Two handy things. One is to make sure every jail has an exec.consolelog > file set, so if it gets partway through startup and then goes away, you > can see what it did up until then. Second is the "-v" flag to jail(8). > Add it to jail_flags in your rc.conf, and then comment out the bit in > /etc/rc.d/jail that removes the temp file for jail(8)'s output ($_tmp). > Watch out for parallel starts - they just went to /dev/null until recently. Thank you for your advice. I added -v flag and commented out rm $_tmp We are not using parallel start. I rebooted server tonight and another jail didn't start. Nothing was logged to jail's console log file But I found this in tmp file: # grep costa jail.rwe8dsFF costa: run command as root: /sbin/mount -t nullfs -o ro /vol0/jail/_basejail /vol0/jail/costa/basejail mount_nullfs: /vol0/jail/costa/basejail: Operation not supported by device jail: costa: /sbin/mount -t nullfs -o ro /vol0/jail/_basejail /vol0/jail/costa/basejail: failed This is strange, because all jails are using the same _basejail and I can manually mount this directory root@cage ~/# /sbin/mount -t nullfs -o ro /vol0/jail/_basejail /vol0/jail/costa/basejail root@cage ~/# mount | grep costa tank/vol0/jail/costa on /vol0/jail/costa (zfs, local, noatime, nfsv4acls) /vol0/jail/_basejail on /vol0/jail/costa/basejail (nullfs, local, read-only) root@cage ~/# umount /vol0/jail/costa/basejail And I can start the jail by rc script as well root@cage ~/# service jail start costa Starting jails: costa. Do you have any idea what is going on? Miroslav Lachman From owner-freebsd-jail@freebsd.org Wed Oct 12 01:38:04 2016 Return-Path: Delivered-To: freebsd-jail@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03BE8C0C6D5 for ; Wed, 12 Oct 2016 01:38:04 +0000 (UTC) (envelope-from jamie@freebsd.org) Received: from gritton.org (gritton.org [199.192.165.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "www.gritton.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id AC977DF8 for ; Wed, 12 Oct 2016 01:38:03 +0000 (UTC) (envelope-from jamie@freebsd.org) Received: from gritton.org (gritton.org [199.192.165.131]) by gritton.org (8.15.2/8.15.2) with ESMTPS id u9C1brIY000518 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 11 Oct 2016 19:37:53 -0600 (MDT) (envelope-from jamie@freebsd.org) Received: (from www@localhost) by gritton.org (8.15.2/8.15.2/Submit) id u9C1bqW8000515; Tue, 11 Oct 2016 19:37:52 -0600 (MDT) (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: some (random) jails are not started after reboot X-PHP-Originating-Script: 0:rcube.php MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 11 Oct 2016 19:37:52 -0600 From: James Gritton In-Reply-To: <57FD87D9.4050209@quip.cz> References: <57F63D18.1060701@quip.cz> <7c2f0434326257c5d2cbbb97a5c5e787@gritton.org> <57FD87D9.4050209@quip.cz> Message-ID: <87e892047759b32800aca4422c5b129a@gritton.org> X-Sender: jamie@freebsd.org User-Agent: Roundcube Webmail/1.2.0 X-BeenThere: freebsd-jail@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Discussion about FreeBSD jail\(8\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2016 01:38:04 -0000 On 2016-10-11 18:46, Miroslav Lachman wrote: > James Gritton wrote on 2016/10/06 18:11: >> On 2016-10-06 06:01, Miroslav Lachman wrote: > > [...] > >>> This is production machine so I can't play with it too much. But does >>> anybody else seen it too? >>> How can I debug it on next reboot? >> >> Two handy things. One is to make sure every jail has an >> exec.consolelog >> file set, so if it gets partway through startup and then goes away, >> you >> can see what it did up until then. Second is the "-v" flag to >> jail(8). >> Add it to jail_flags in your rc.conf, and then comment out the bit in >> /etc/rc.d/jail that removes the temp file for jail(8)'s output >> ($_tmp). >> Watch out for parallel starts - they just went to /dev/null until >> recently. > > Thank you for your advice. > I added -v flag and commented out rm $_tmp > We are not using parallel start. > I rebooted server tonight and another jail didn't start. > > Nothing was logged to jail's console log file > > But I found this in tmp file: > > # grep costa jail.rwe8dsFF > costa: run command as root: /sbin/mount -t nullfs -o ro > /vol0/jail/_basejail /vol0/jail/costa/basejail > mount_nullfs: /vol0/jail/costa/basejail: Operation not supported by > device > jail: costa: /sbin/mount -t nullfs -o ro /vol0/jail/_basejail > /vol0/jail/costa/basejail: failed > > > This is strange, because all jails are using the same _basejail and I > can manually mount this directory > > root@cage ~/# /sbin/mount -t nullfs -o ro /vol0/jail/_basejail > /vol0/jail/costa/basejail > > root@cage ~/# mount | grep costa > tank/vol0/jail/costa on /vol0/jail/costa (zfs, local, noatime, > nfsv4acls) > /vol0/jail/_basejail on /vol0/jail/costa/basejail (nullfs, local, > read-only) > > root@cage ~/# umount /vol0/jail/costa/basejail > > > And I can start the jail by rc script as well > > > root@cage ~/# service jail start costa > Starting jails: costa. > > > Do you have any idea what is going on? I don't know the cause, but I've seen similar problems before with nullfs mounts. A possible workaround is to replace the mount with an exec.prestart script that tries the mount and if it fails waits a few seconds and tries again (also an exec.poststop command to unmount it). I haven't tried such a thing myself, but then I've never had this problem either. It might have to do with the main jail mount being zfs, but that's just a guess. - Jamie