From owner-freebsd-current@FreeBSD.ORG Tue Jul 29 09:40:31 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 753E337B401 for ; Tue, 29 Jul 2003 09:40:31 -0700 (PDT) Received: from mail.liwing.de (mail.liwing.de [213.70.188.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id C566B43FAF for ; Tue, 29 Jul 2003 09:40:29 -0700 (PDT) (envelope-from rehsack@liwing.de) Received: (qmail 68356 invoked from network); 29 Jul 2003 16:40:26 -0000 Received: from stingray.liwing.de (HELO liwing.de) ([213.70.188.164]) (envelope-sender ) by mail.liwing.de (qmail-ldap-1.03) with SMTP for ; 29 Jul 2003 16:40:26 -0000 Message-ID: <3F26A37A.7090402@liwing.de> Date: Tue, 29 Jul 2003 18:40:26 +0200 From: Jens Rehsack Organization: LiWing IT-Services User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: de-de, de, en-us, en MIME-Version: 1.0 To: FreeBSD-Current List Content-Type: multipart/mixed; boundary="------------020805040906090900000605" cc: Clement Laforet Subject: [PATCH] jail NG schript patch for mounting devfs and procfs automatically X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jul 2003 16:40:31 -0000 This is a multi-part message in MIME format. --------------020805040906090900000605 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hi all, hi Clement, I updated the rcng jail start script to mount devfs and procfs into the jail if wanted. Adding entries to /etc/fstab didn't work properly, because the jail filesystem wasn't mounted when the startup process wants to mount it. Going this way allows us to control which jail could be used via ssh (or another remote shell), too. Any comments gladly welcome. If it's useful for FreeBSD, I will write the rc.conf(5) update, too. Please inform me to do this. Regards, Jens --------------020805040906090900000605 Content-Type: text/plain; name="patch-etc_rc.d_jail" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="patch-etc_rc.d_jail" --- etc/rc.d/jail.orig Mon May 5 15:38:41 2003 +++ etc/rc.d/jail Tue Jul 29 14:49:34 2003 @@ -53,6 +53,16 @@ eval jail_hostname=\"\$jail_${_jail}_hostname\" eval jail_ip=\"\$jail_${_jail}_ip\" eval jail_exec=\"\$jail_${_jail}_exec\" + eval jail_devfs=\"\$jail_${_jail}_mount_devfs\" + eval jail_procfs=\"\$jail_${_jail}_mount_procfs\" + if [ -n "${jail_devfs}" ] && checkyesno jail_devfs ; then + echo "Mounting devfs to ${jail_rootdir}/dev" + mount -t devfs devfs ${jail_rootdir}/dev + fi; + if [ -n "${jail_procfs}" ] && checkyesno jail_procfs ; then + echo "Mounting procfs to ${jail_rootdir}/proc" + mount -t procfs procfs ${jail_rootdir}/proc + fi; [ -z ${jail_exec} ] && jail_exec="/bin/sh /etc/rc" jail ${jail_rootdir} ${jail_hostname} ${jail_ip} ${jail_exec} --------------020805040906090900000605--