summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/rc.subr9
1 files changed, 7 insertions, 2 deletions
diff --git a/etc/rc.subr b/etc/rc.subr
index f89c699..c20cd43 100644
--- a/etc/rc.subr
+++ b/etc/rc.subr
@@ -666,12 +666,17 @@ chroot ${_user:+-u $_user }${_group:+-g $_group }${_groups:+-G $_groups }\
$_chroot $command $rc_flags $command_args"
else
_doit="\
-${_chdir:+cd $_chdir; }\
-${_nice:+nice -n $_nice }\
+${_chdir:+cd $_chdir && }\
$command $rc_flags $command_args"
if [ -n "$_user" ]; then
_doit="su -m $_user -c 'sh -c \"$_doit\"'"
fi
+ if [ -n "$_nice" ]; then
+ if [ -z "$_user" ]; then
+ _doit="sh -c \"$_doit\""
+ fi
+ _doit="nice -n $_nice $_doit"
+ fi
fi
# run the full command;
OpenPOWER on IntegriCloud