summaryrefslogtreecommitdiff
path: root/scripts/safe_mysqld.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/safe_mysqld.sh')
-rw-r--r--scripts/safe_mysqld.sh11
1 files changed, 8 insertions, 3 deletions
diff --git a/scripts/safe_mysqld.sh b/scripts/safe_mysqld.sh
index 2272443c972..96568bd5d19 100644
--- a/scripts/safe_mysqld.sh
+++ b/scripts/safe_mysqld.sh
@@ -157,9 +157,14 @@ NOHUP_NICENESS="nohup"
if test -w /
then
NOHUP_NICENESS=`nohup nice 2>&1`
- if test $? -eq 0 && test x"$NOHUP_NICENESS" != x0 && nice --1 echo foo > /dev/null 2>&1
- then
- NOHUP_NICENESS="nice -n $NOHUP_NICENESS nohup"
+ if test $? -eq 0 && test x"$NOHUP_NICENESS" != x0 && nice --1 echo foo > /dev/null 2>&1
+ then
+ if $NOHUP_NICENESS -gt 0
+ then
+ $NOHUP_NICENESS="nice --$NOHUP_NICENESS nohup"
+ else
+ NOHUP_NICENESS="nice -$NOHUP_NICENESS nohup"
+ fi
else
NOHUP_NICENESS="nohup"
fi