Index: src/etc/rc.subr =================================================================== RCS file: /home/ncvs/src/etc/rc.subr,v retrieving revision 1.80 diff -u -r1.80 rc.subr --- src/etc/rc.subr 26 Jan 2008 11:22:11 -0000 1.80 +++ src/etc/rc.subr 29 Apr 2008 16:09:07 -0000 @@ -424,6 +424,10 @@ # # ${name}_nice n Nice level to run ${command} at. # +# ${name}_rtprio n Realtime scheduling priority to run ${command} at. +# +# ${name}_idprio n Idletime scheduling priority to run ${command} at. +# # ${name}_user n User to run ${command} as, using su(1) if not # using ${name}_chroot. # Requires /usr to be mounted. @@ -600,7 +604,8 @@ 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 \ + _rtprio=\$${name}_rtprio _idprio=\$${name}_idprio if [ -n "$_user" ]; then # unset $_user if running as that user if [ "$_user" = "$(eval $IDCMD)" ]; then @@ -677,6 +682,8 @@ if [ -n "$_chroot" ]; then _doit="\ ${_nice:+nice -n $_nice }\ +${_rtprio:+rtprio $_rtprio }\ +${_idprio:+idprio $_idprio }\ chroot ${_user:+-u $_user }${_group:+-g $_group }${_groups:+-G $_groups }\ $_chroot $command $rc_flags $command_args" else @@ -686,12 +693,20 @@ if [ -n "$_user" ]; then _doit="su -m $_user -c 'sh -c \"$_doit\"'" fi - if [ -n "$_nice" ]; then + if [ -n "$_nice$_rtprio$_idprio" ]; then if [ -z "$_user" ]; then _doit="sh -c \"$_doit\"" - fi + fi + fi + if [ -n "$_nice" ]; then _doit="nice -n $_nice $_doit" fi + if [ -n "$_rtprio" ]; then + _doit="rtprio $_rtprio $_doit" + fi + if [ -n "$_idprio" ]; then + _doit="idprio $_idprio $_doit" + fi fi # run the full command Index: src/share/man/man8/rc.subr.8 =================================================================== RCS file: /home/ncvs/src/share/man/man8/rc.subr.8,v retrieving revision 1.20 diff -u -r1.20 rc.subr.8 --- src/share/man/man8/rc.subr.8 31 Mar 2008 14:11:37 -0000 1.20 +++ src/share/man/man8/rc.subr.8 29 Apr 2008 16:30:21 -0000 @@ -607,6 +607,22 @@ Only supported after .Pa /usr is mounted. +.It Va ${name}_rtprio +.Xr rtprio 1 +priority to run +.Va command +as. +Only supported after +.Pa /usr +is mounted. +.It Va ${name}_idprio +.Xr idprio 1 +priority to run +.Va command +as. +Only supported after +.Pa /usr +is mounted. .It Va ${name}_program Full path to the command. Overrides