diff options
author | unknown <lenz@mysql.com> | 2003-06-12 13:52:24 +0200 |
---|---|---|
committer | unknown <lenz@mysql.com> | 2003-06-12 13:52:24 +0200 |
commit | 5efaeb958e9fa23ec53237da09b50c23507b367c (patch) | |
tree | 947bf4096f6f6ff7c1f89962bbfbd13af018bfe9 /scripts/mysqld_safe.sh | |
parent | 1273bf20c8ea79d2c74c043c9e1072195b755e5c (diff) | |
download | mariadb-git-5efaeb958e9fa23ec53237da09b50c23507b367c.tar.gz |
- applied patch for mysqld_safe from Christian Hammers to be able to
define a different niceness level in my.cnf (Bug #627)
scripts/mysqld_safe.sh:
- applied patch from Christian Hammers to be able to define a different
niceness level in my.cnf (Bug #627)
Diffstat (limited to 'scripts/mysqld_safe.sh')
-rw-r--r-- | scripts/mysqld_safe.sh | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index e400c27b84c..626e04b1579 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -70,6 +70,7 @@ parse_arguments() { MYSQLD="mysqld" fi ;; + --nice=*) niceness=`echo "$arg" | sed -e "s;--nice=;;"` ;; *) if test -n "$pick_args" then @@ -110,6 +111,7 @@ fi MYSQL_UNIX_PORT=${MYSQL_UNIX_PORT:-@MYSQL_UNIX_ADDR@} MYSQL_TCP_PORT=${MYSQL_TCP_PORT:-@MYSQL_TCP_PORT@} user=@MYSQLD_USER@ +niceness=0 # Use the mysqld-max binary by default if the user doesn't specify a binary if test -x $ledir/mysqld-max @@ -167,7 +169,12 @@ export MYSQL_UNIX_PORT export MYSQL_TCP_PORT -NOHUP_NICENESS="nohup" +if test $niceness -eq 0 +then + NOHUP_NICENESS="nohup" +else + NOHUP_NICENESS="nohup nice -$niceness" +fi # Using nice with no args to get the niceness level is GNU-specific. # This check could be extended for other operating systems (e.g., @@ -198,8 +205,10 @@ then nice --$nice_value_diff echo testing > /dev/null 2>&1 then # nohup increases the priority (bad), and we are permitted - # to lower the priority - NOHUP_NICENESS="nice --$nice_value_diff nohup" + # to lower the priority with respect to the value the user + # might have been given + niceness=`expr $niceness - $nice_value_diff` + NOHUP_NICENESS="nice -$niceness nohup" fi fi else |