From owner-freebsd-rc@FreeBSD.ORG Sun Jan 22 20:46:12 2012 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 300071065674; Sun, 22 Jan 2012 20:46:12 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-tul01m020-f182.google.com (mail-tul01m020-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id D9F938FC14; Sun, 22 Jan 2012 20:46:11 +0000 (UTC) Received: by obcwo16 with SMTP id wo16so3549022obc.13 for ; Sun, 22 Jan 2012 12:46:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=dmr4Oe7+GNA6jvrpgXkavOB5XptNczrPexiByNV2UEw=; b=XAjWG31CgRuem/QWBPs2OG+tSsr/LLwb4mANS5pZsZobuglnqqWCMHpQ6KcY5F2MfN aK6kRYIb9q63qZ5sf2Iv8NZjdgGT8lirbsZqwSQq1k1AtAwwVt6eowWqRglOGC4+XoXW S7+B/mp4Z3xgvN6zlIvXW4F/XKyBqDJr1x1O0= MIME-Version: 1.0 Received: by 10.182.48.36 with SMTP id i4mr5678855obn.9.1327265171065; Sun, 22 Jan 2012 12:46:11 -0800 (PST) Received: by 10.182.5.162 with HTTP; Sun, 22 Jan 2012 12:46:10 -0800 (PST) In-Reply-To: References: <4F14F4FF.902@erdgeist.org> <20120120230300.GE87357@lor.one-eyed-alien.net> <20120121233757.GB31224@deviant.kiev.zoral.com.ua> Date: Sun, 22 Jan 2012 12:46:10 -0800 Message-ID: From: Garrett Cooper To: Dirk Engling Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: simon , Brooks Davis , freebsd-rc@freebsd.org Subject: Re: Bumping a pet bug X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jan 2012 20:46:12 -0000 On Sun, Jan 22, 2012 at 5:46 AM, Dirk Engling wrote= : > > On Sun, 22 Jan 2012, simon wrote: > >>> Just curious. Why devfs mounts can fail ? >> >> >> If $JAIL/dev doesn't exist or if one has messed up the devfs rulset >> configuration are two reasons I can think of. > > > I guess that when you forget sudo, this is where you end up. The script j= ust > does not know when to quit. Other scenarios include situations where the > jails mountpoint is for some reasons unavailable. > > Here is the output I get from not running the jail script as root: > > Starting jails:mount_nullfs: Operation not permitted > devfs rule: ioctl DEVFSIO_RGETNEXT: Operation not permitted > mount: dev : Operation not permitted > /etc/rc.d/jail: WARNING: devfs_domount(): Unable to mount devfs on > /usr/jails/foo.com/dev > /etc/rc.d/jail: WARNING: devfs_mount_jail: devfs was not mounted on > /usr/jails/foo.com/dev > ln: log: Permission denied > mount: /usr/jails/foo.com/dev/fd: No such file or directory > mount: proc : Operation not permitted > =A0cannot start jail "foo_com": Probably a simple case of lack of set -e in the script with appropriate error catching logic. The jailme and portsjail [*] scripts had similar issues. Thanks, -Garrett [*] I submitted a patch to make portsjail set -e aware: http://trac.pcbsd.org/ticket/487