From owner-svn-src-stable@FreeBSD.ORG Fri Jul 12 01:16:20 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5903ACBE; Fri, 12 Jul 2013 01:16:20 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 30292107F; Fri, 12 Jul 2013 01:16:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6C1GKsa094698; Fri, 12 Jul 2013 01:16:20 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6C1GJio094696; Fri, 12 Jul 2013 01:16:19 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201307120116.r6C1GJio094696@svn.freebsd.org> From: Hiroki Sato Date: Fri, 12 Jul 2013 01:16:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r253233 - in stable/9: etc share/man/man5 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 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: Fri, 12 Jul 2013 01:16:20 -0000 Author: hrs Date: Fri Jul 12 01:16:19 2013 New Revision: 253233 URL: http://svnweb.freebsd.org/changeset/base/253233 Log: MFC 242184: Add setfib(1) support for services as _fib in rc.conf. Modified: stable/9/etc/rc.subr stable/9/share/man/man5/rc.conf.5 Directory Properties: stable/9/etc/ (props changed) stable/9/share/man/man5/ (props changed) Modified: stable/9/etc/rc.subr ============================================================================== --- stable/9/etc/rc.subr Fri Jul 12 01:12:28 2013 (r253232) +++ stable/9/etc/rc.subr Fri Jul 12 01:16:19 2013 (r253233) @@ -503,6 +503,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 @@ -681,7 +683,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 @@ -765,11 +768,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: stable/9/share/man/man5/rc.conf.5 ============================================================================== --- stable/9/share/man/man5/rc.conf.5 Fri Jul 12 01:12:28 2013 (r253232) +++ stable/9/share/man/man5/rc.conf.5 Fri Jul 12 01:16:19 2013 (r253233) @@ -168,6 +168,27 @@ If set to .Dq Li NO , no swapfile is installed, otherwise the value is used as the full pathname to a file to use for additional swap space. +.It Ao Ar name Ac Ns Va _chroot +.Pq Vt str +.Xr chroot +to this directory before running the service. +.It Ao Ar name Ac Ns Va _user +.Pq Vt str +Run the service under this user account. +.It Ao Ar name Ac Ns Va _group +.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 +.Xr nice 1 +value to run the service under. .It Va apm_enable .Pq Vt bool If set to