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