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

Collapse All | Expand All

(-)rc.subr (-1 / +10 lines)
Lines 371-376 Link Here
371
#
371
#
372
#	${name}_nice	n	Nice level to run ${command} at.
372
#	${name}_nice	n	Nice level to run ${command} at.
373
#
373
#
374
#	${name}_rtprio	n	Realtime scheduling priority to run ${command} at.
375
#
376
#	${name}_idprio	n	Idletime scheduling priority to run ${command} at.
377
#
374
#	${name}_user	n	User to run ${command} as, using su(1) if not
378
#	${name}_user	n	User to run ${command} as, using su(1) if not
375
#				using ${name}_chroot.
379
#				using ${name}_chroot.
376
#				Requires /usr to be mounted.
380
#				Requires /usr to be mounted.
Lines 526-532 Link Here
526
	fi
530
	fi
527
	eval _chdir=\$${name}_chdir	_chroot=\$${name}_chroot \
531
	eval _chdir=\$${name}_chdir	_chroot=\$${name}_chroot \
528
	    _nice=\$${name}_nice	_user=\$${name}_user \
532
	    _nice=\$${name}_nice	_user=\$${name}_user \
529
	    _group=\$${name}_group	_groups=\$${name}_groups
533
	    _group=\$${name}_group	_groups=\$${name}_groups \
534
	    _rtprio=\$${name}_rtprio	_idprio=\$${name}_idprio
530
535
531
	if [ -n "$_user" ]; then	# unset $_user if running as that user
536
	if [ -n "$_user" ]; then	# unset $_user if running as that user
532
		if [ "$_user" = "$(eval $IDCMD)" ]; then
537
		if [ "$_user" = "$(eval $IDCMD)" ]; then
Lines 652-663 Link Here
652
			if [ -n "$_chroot" ]; then
657
			if [ -n "$_chroot" ]; then
653
				_doit="\
658
				_doit="\
654
${_nice:+nice -n $_nice }\
659
${_nice:+nice -n $_nice }\
660
${_rtprio:+rtprio $_rtprio }\
661
${_idprio:+idprio $_idprio }\
655
chroot ${_user:+-u $_user }${_group:+-g $_group }${_groups:+-G $_groups }\
662
chroot ${_user:+-u $_user }${_group:+-g $_group }${_groups:+-G $_groups }\
656
$_chroot $command $rc_flags $command_args"
663
$_chroot $command $rc_flags $command_args"
657
			else
664
			else
658
				_doit="\
665
				_doit="\
659
${_chdir:+cd $_chdir; }\
666
${_chdir:+cd $_chdir; }\
660
${_nice:+nice -n $_nice }\
667
${_nice:+nice -n $_nice }\
668
${_rtprio:+rtprio $_rtprio }\
669
${_idprio:+idprio $_idprio }\
661
$command $rc_flags $command_args"
670
$command $rc_flags $command_args"
662
				if [ -n "$_user" ]; then
671
				if [ -n "$_user" ]; then
663
				    _doit="su -m $_user -c 'sh -c \"$_doit\"'"
672
				    _doit="su -m $_user -c 'sh -c \"$_doit\"'"

Return to bug 123222