Index: rc.subr =================================================================== RCS file: /home/ncvs/src/etc/rc.subr,v retrieving revision 1.34.2.23 diff -u -r1.34.2.23 rc.subr --- rc.subr 25 Oct 2007 14:04:18 -0000 1.34.2.23 +++ rc.subr 29 Apr 2008 16:12:51 -0000 @@ -423,6 +423,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. @@ -591,7 +595,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 @@ -662,6 +667,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 @@ -671,12 +678,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