ionice may not be available
This commit is contained in:
parent
3fd7a11bed
commit
6510eb17fc
@ -24,47 +24,50 @@ getConfigGeneral() {
|
|||||||
unset expr
|
unset expr
|
||||||
;;
|
;;
|
||||||
'ionice')
|
'ionice')
|
||||||
read class niceness <<<"$value"
|
if which ionice >/dev/null
|
||||||
case $class in
|
then
|
||||||
1)
|
read class niceness <<<"$value"
|
||||||
# real-time class, only root can do that
|
case $class in
|
||||||
if (( UID ))
|
1)
|
||||||
then
|
# real-time class, only root can do that
|
||||||
echo "IO class 'realtime' is"\
|
if (( UID ))
|
||||||
"not available to unprivileged"\
|
then
|
||||||
"users" >&2
|
echo "IO class 'realtime' is"\
|
||||||
|
"not available to unprivileged"\
|
||||||
|
"users" >&2
|
||||||
|
exit $EIONICE
|
||||||
|
fi
|
||||||
|
if [ -n "$niceness" ] \
|
||||||
|
&& (( niceness >= 0 && niceness <= 7 ))
|
||||||
|
then
|
||||||
|
ionice="ionice -c1 -n$niceness "
|
||||||
|
else
|
||||||
|
echo "Invalid IO priority"\
|
||||||
|
"'$niceness'" >&2
|
||||||
|
exit $EIONICE
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
2)
|
||||||
|
if [ -n "$niceness" ] \
|
||||||
|
&& (( niceness >= 0 && niceness <= 7 ))
|
||||||
|
then
|
||||||
|
ionice="ionice -c2 -n$niceness "
|
||||||
|
else
|
||||||
|
echo "Invalid IO priority"\
|
||||||
|
"'$niceness'" >&2
|
||||||
|
exit $EIONICE
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
3)
|
||||||
|
ionice="ionice -c3 "
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Invalid ionice parameters $value"\
|
||||||
|
>&2
|
||||||
exit $EIONICE
|
exit $EIONICE
|
||||||
fi
|
;;
|
||||||
if [ -n "$niceness" ] \
|
esac
|
||||||
&& (( niceness >= 0 && niceness <= 7 ))
|
fi
|
||||||
then
|
|
||||||
ionice="ionice -c1 -n$niceness "
|
|
||||||
else
|
|
||||||
echo "Invalid IO priority"\
|
|
||||||
"'$niceness'" >&2
|
|
||||||
exit $EIONICE
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
2)
|
|
||||||
if [ -n "$niceness" ] \
|
|
||||||
&& (( niceness >= 0 && niceness <= 7 ))
|
|
||||||
then
|
|
||||||
ionice="ionice -c2 -n$niceness "
|
|
||||||
else
|
|
||||||
echo "Invalid IO priority"\
|
|
||||||
"'$niceness'" >&2
|
|
||||||
exit $EIONICE
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
3)
|
|
||||||
ionice="ionice -c3 "
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Invalid ionice parameters $value"\
|
|
||||||
>&2
|
|
||||||
exit $EIONICE
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
;;
|
||||||
'temporary-directory')
|
'temporary-directory')
|
||||||
tempdir="$value"
|
tempdir="$value"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user