View | Details | Raw Unified | Return to bug 123222 | Differences between
and this patch

Collapse All | Expand All

(-)src/etc/rc.subr (-3 / +18 lines)
Lines 424-429 Link Here
424
#
424
#
425
#	${name}_nice	n	Nice level to run ${command} at.
425
#	${name}_nice	n	Nice level to run ${command} at.
426
#
426
#
427
#	${name}_rtprio	n	Realtime scheduling priority to run ${command} at.
428
#
429
#	${name}_idprio	n	Idletime scheduling priority to run ${command} at.
430
#
427
#	${name}_user	n	User to run ${command} as, using su(1) if not
431
#	${name}_user	n	User to run ${command} as, using su(1) if not
428
#				using ${name}_chroot.
432
#				using ${name}_chroot.
429
#				Requires /usr to be mounted.
433
#				Requires /usr to be mounted.
Lines 600-606 Link Here
600
	fi
604
	fi
601
	eval _chdir=\$${name}_chdir	_chroot=\$${name}_chroot \
605
	eval _chdir=\$${name}_chdir	_chroot=\$${name}_chroot \
602
	    _nice=\$${name}_nice	_user=\$${name}_user \
606
	    _nice=\$${name}_nice	_user=\$${name}_user \
603
	    _group=\$${name}_group	_groups=\$${name}_groups
607
	    _group=\$${name}_group	_groups=\$${name}_groups \
608
	    _rtprio=\$${name}_rtprio	_idprio=\$${name}_idprio
604
609
605
	if [ -n "$_user" ]; then	# unset $_user if running as that user
610
	if [ -n "$_user" ]; then	# unset $_user if running as that user
606
		if [ "$_user" = "$(eval $IDCMD)" ]; then
611
		if [ "$_user" = "$(eval $IDCMD)" ]; then
Lines 677-682 Link Here
677
			if [ -n "$_chroot" ]; then
682
			if [ -n "$_chroot" ]; then
678
				_doit="\
683
				_doit="\
679
${_nice:+nice -n $_nice }\
684
${_nice:+nice -n $_nice }\
685
${_rtprio:+rtprio $_rtprio }\
686
${_idprio:+idprio $_idprio }\
680
chroot ${_user:+-u $_user }${_group:+-g $_group }${_groups:+-G $_groups }\
687
chroot ${_user:+-u $_user }${_group:+-g $_group }${_groups:+-G $_groups }\
681
$_chroot $command $rc_flags $command_args"
688
$_chroot $command $rc_flags $command_args"
682
			else
689
			else
Lines 686-697 Link Here
686
				if [ -n "$_user" ]; then
693
				if [ -n "$_user" ]; then
687
				    _doit="su -m $_user -c 'sh -c \"$_doit\"'"
694
				    _doit="su -m $_user -c 'sh -c \"$_doit\"'"
688
				fi
695
				fi
689
				if [ -n "$_nice" ]; then
696
				if [ -n "$_nice$_rtprio$_idprio" ]; then
690
					if [ -z "$_user" ]; then
697
					if [ -z "$_user" ]; then
691
						_doit="sh -c \"$_doit\""
698
						_doit="sh -c \"$_doit\""
692
					fi	
699
					fi
700
				fi
701
				if [ -n "$_nice" ]; then
693
					_doit="nice -n $_nice $_doit"
702
					_doit="nice -n $_nice $_doit"
694
				fi
703
				fi
704
				if [ -n "$_rtprio" ]; then
705
					_doit="rtprio $_rtprio $_doit"
706
				fi
707
				if [ -n "$_idprio" ]; then
708
					_doit="idprio $_idprio $_doit"
709
				fi
695
			fi
710
			fi
696
711
697
					# run the full command
712
					# run the full command
(-)src/share/man/man8/rc.subr.8 (+16 lines)
Lines 607-612 Link Here
607
Only supported after
607
Only supported after
608
.Pa /usr
608
.Pa /usr
609
is mounted.
609
is mounted.
610
.It Va ${name}_rtprio
611
.Xr rtprio 1
612
priority to run
613
.Va command
614
as.
615
Only supported after
616
.Pa /usr
617
is mounted.
618
.It Va ${name}_idprio
619
.Xr idprio 1
620
priority to run
621
.Va command
622
as.
623
Only supported after
624
.Pa /usr
625
is mounted.
610
.It Va ${name}_program
626
.It Va ${name}_program
611
Full path to the command.
627
Full path to the command.
612
Overrides
628
Overrides

Return to bug 123222