Date: Fri, 12 Jul 2013 01:16:19 +0000 (UTC) From: Hiroki Sato <hrs@FreeBSD.org> 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 Message-ID: <201307120116.r6C1GJio094696@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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 <name>_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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201307120116.r6C1GJio094696>