Allow for setting negative priority (niceness) when $foo_user is non-root.
The order in _doit must be "nice su", not "su nice", for that. In addition, don't ignore the exit status from "cd $foo_chdir". Reviewed by: freebsd-rc (silence) MFC after: 1 week
This commit is contained in:
parent
81cd89bd43
commit
ae44d27bfd
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=161396
@ -666,12 +666,17 @@ chroot ${_user:+-u $_user }${_group:+-g $_group }${_groups:+-G $_groups }\
|
|||||||
$_chroot $command $rc_flags $command_args"
|
$_chroot $command $rc_flags $command_args"
|
||||||
else
|
else
|
||||||
_doit="\
|
_doit="\
|
||||||
${_chdir:+cd $_chdir; }\
|
${_chdir:+cd $_chdir && }\
|
||||||
${_nice:+nice -n $_nice }\
|
|
||||||
$command $rc_flags $command_args"
|
$command $rc_flags $command_args"
|
||||||
if [ -n "$_user" ]; then
|
if [ -n "$_user" ]; then
|
||||||
_doit="su -m $_user -c 'sh -c \"$_doit\"'"
|
_doit="su -m $_user -c 'sh -c \"$_doit\"'"
|
||||||
fi
|
fi
|
||||||
|
if [ -n "$_nice" ]; then
|
||||||
|
if [ -z "$_user" ]; then
|
||||||
|
_doit="sh -c \"$_doit\""
|
||||||
|
fi
|
||||||
|
_doit="nice -n $_nice $_doit"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# run the full command;
|
# run the full command;
|
||||||
|
Loading…
Reference in New Issue
Block a user