From owner-svn-src-stable@FreeBSD.ORG Wed Jan 7 15:31:47 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D011106567A; Wed, 7 Jan 2009 15:31:47 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 49BA28FC13; Wed, 7 Jan 2009 15:31:47 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n07FVlE0090819; Wed, 7 Jan 2009 15:31:47 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n07FVlNx090816; Wed, 7 Jan 2009 15:31:47 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200901071531.n07FVlNx090816@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 7 Jan 2009 15:31:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186863 - in stable/7: etc etc/defaults etc/rc.d share/man/man5 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jan 2009 15:31:48 -0000 Author: bz Date: Wed Jan 7 15:31:46 2009 New Revision: 186863 URL: http://svn.freebsd.org/changeset/base/186863 Log: MFC: r183100 Allow a jail to be started with a specific route fib. Modified: stable/7/etc/ (props changed) stable/7/etc/defaults/rc.conf stable/7/etc/rc.d/jail stable/7/share/man/man5/ (props changed) stable/7/share/man/man5/rc.conf.5 Modified: stable/7/etc/defaults/rc.conf ============================================================================== --- stable/7/etc/defaults/rc.conf Wed Jan 7 15:28:47 2009 (r186862) +++ stable/7/etc/defaults/rc.conf Wed Jan 7 15:31:46 2009 (r186863) @@ -622,6 +622,7 @@ jail_sysvipc_allow="NO" # Allow SystemV #jail_example_hostname="default.domain.com" # Jail's hostname #jail_example_ip="192.168.0.10" # Jail's IP number #jail_example_interface="" # Interface to create the IP alias on +#jail_example_fib="0" # routing table for setfib(1) #jail_example_exec_start="/bin/sh /etc/rc" # command to execute in jail for starting #jail_example_exec_afterstart0="/bin/sh command" # command to execute after the one for # starting the jail. More than one can be Modified: stable/7/etc/rc.d/jail ============================================================================== --- stable/7/etc/rc.d/jail Wed Jan 7 15:28:47 2009 (r186862) +++ stable/7/etc/rc.d/jail Wed Jan 7 15:31:46 2009 (r186863) @@ -83,6 +83,7 @@ init_variables() [ -z "${_flags}" ] && _flags="-l -U root" eval _consolelog=\"\${jail_${_j}_consolelog:-${jail_consolelog}}\" [ -z "${_consolelog}" ] && _consolelog="/var/log/jail_${_j}_console.log" + eval _fib=\"\${jail_${_j}_fib:-${jail_fib}}\" # Debugging aid # @@ -93,6 +94,7 @@ init_variables() debug "$_j hostname: $_hostname" debug "$_j ip: $_ip" debug "$_j interface: $_interface" + debug "$_j fib: $_fib" debug "$_j root: $_rootdir" debug "$_j devdir: $_devdir" debug "$_j fdescdir: $_fdescdir" @@ -297,6 +299,11 @@ jail_start() if [ -n "${_interface}" ]; then ifconfig ${_interface} alias ${_ip} netmask 255.255.255.255 fi + if [ -n "${_fib}" ]; then + _setfib="setfib -F '${_fib}'" + else + _setfib="" + fi if checkyesno _mount; then info "Mounting fstab for jail ${_jail} (${_fstab})" if [ ! -f "${_fstab}" ]; then @@ -350,7 +357,7 @@ jail_start() fi fi _tmp_jail=${_tmp_dir}/jail.$$ - eval jail ${_flags} -i ${_rootdir} ${_hostname} \ + eval ${_setfib} jail ${_flags} -i ${_rootdir} ${_hostname} \ ${_ip} ${_exec_start} > ${_tmp_jail} 2>&1 if [ "$?" -eq 0 ] ; then Modified: stable/7/share/man/man5/rc.conf.5 ============================================================================== --- stable/7/share/man/man5/rc.conf.5 Wed Jan 7 15:28:47 2009 (r186862) +++ stable/7/share/man/man5/rc.conf.5 Wed Jan 7 15:31:46 2009 (r186863) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 6, 2008 +.Dd September 16, 2008 .Dt RC.CONF 5 .Os .Sh NAME @@ -3412,6 +3412,11 @@ These are flags to pass to Unset by default. When set, sets the interface to use when setting IP address alias. Note that the alias is created at jail startup and removed at jail shutdown. +.It Va jail_ Ns Ao Ar jname Ac Ns Va _fib +.Pq Vt str +Unset by default. +When set, the jail is started with the specified routing table via +.Xr setfib 1 . .It Va jail_ Ns Ao Ar jname Ac Ns Va _fstab .Pq Vt str Set to