From owner-svn-src-all@FreeBSD.ORG Sat Oct 27 19:09:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4F00B220; Sat, 27 Oct 2012 19:09:10 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1E0668FC08; Sat, 27 Oct 2012 19:09:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9RJ99WG039300; Sat, 27 Oct 2012 19:09:09 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9RJ99fi039297; Sat, 27 Oct 2012 19:09:09 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201210271909.q9RJ99fi039297@svn.freebsd.org> From: Hiroki Sato Date: Sat, 27 Oct 2012 19:09:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242184 - in head: etc share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Oct 2012 19:09:10 -0000 Author: hrs Date: Sat Oct 27 19:09:09 2012 New Revision: 242184 URL: http://svn.freebsd.org/changeset/base/242184 Log: Add setfib(1) support for services as _fib in rc.conf. Modified: head/etc/rc.subr head/share/man/man5/rc.conf.5 Modified: head/etc/rc.subr ============================================================================== --- head/etc/rc.subr Sat Oct 27 17:43:30 2012 (r242183) +++ head/etc/rc.subr Sat Oct 27 19:09:09 2012 (r242184) @@ -462,6 +462,8 @@ check_startmsgs() # NOTE: $flags from the parent environment # can be used to override this. # +# ${name}_fib n Routing table number to run ${command} with. +# # ${name}_nice n Nice level to run ${command} at. # # ${name}_user n User to run ${command} as, using su(1) if not @@ -640,7 +642,8 @@ run_rc_command() fi eval _chdir=\$${name}_chdir _chroot=\$${name}_chroot \ _nice=\$${name}_nice _user=\$${name}_user \ - _group=\$${name}_group _groups=\$${name}_groups + _group=\$${name}_group _groups=\$${name}_groups \ + _fib=\$${name}_fib if [ -n "$_user" ]; then # unset $_user if running as that user if [ "$_user" = "$(eval $IDCMD)" ]; then @@ -721,11 +724,13 @@ run_rc_command() if [ -n "$_chroot" ]; then _doit="\ ${_nice:+nice -n $_nice }\ +${_fib:+setfib -F $_fib }\ chroot ${_user:+-u $_user }${_group:+-g $_group }${_groups:+-G $_groups }\ $_chroot $command $rc_flags $command_args" else _doit="\ ${_chdir:+cd $_chdir && }\ +${_fib:+setfib -F $_fib }\ $command $rc_flags $command_args" if [ -n "$_user" ]; then _doit="su -m $_user -c 'sh -c \"$_doit\"'" Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Sat Oct 27 17:43:30 2012 (r242183) +++ head/share/man/man5/rc.conf.5 Sat Oct 27 19:09:09 2012 (r242184) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 22, 2012 +.Dd October 27, 2012 .Dt RC.CONF 5 .Os .Sh NAME @@ -179,6 +179,11 @@ Run the service under this user account. .Pq Vt str Run the chrooted service under this system group. Unlike the _user setting, this setting has no effect if the service is not chrooted. +.It Ao Ar name Ac Ns Va _fib +.Pq Vt int +The +.Xr setfib 1 +value to run the service under. .It Ao Ar name Ac Ns Va _nice .Pq Vt int The