*** scripts/mysqld_safe Fri Jan 23 13:56:44 2009 --- scripts/mysqld_safe Tue Jan 27 17:36:08 2009 *************** *** 481,486 **** --- 481,514 ---- fi fi + # If OS is Solaris verify user is has proc_priocntl privilege + # and start mysqld in FX class with priority 59 + # Use NOHUP_NICENESS to do this. + SKIP_THREAD_PRIORITY="" + if uname -s > /dev/null 2>&1 + then + if test `uname -s` = "SunOS" + then + # force --skip-thread-priority. This should be + # removed in MySQL 6.x and after + SKIP_THREAD_PRIORITY="--skip-thread-priority" + # If root don't need any privileges + if test `id -u` -eq 0 + then + NOHUP_NICENESS="nohup priocntl -e -c FX -p 59 -m 59" + else + # check for proc_priocntl privilege + if ppriv $$ | grep proc_priocntl > /dev/null 2>&1 + then + NOHUP_NICENESS="nohup priocntl -e -c FX -p 59 -m 59" + else + log_error "[Warning]: $USER does not have proc_priocntl priv. mysqld will run in Solaris TS scheduling class. For optimal performance under heavy load grant $USER proc_priocntl privilege (see man privileges)." + fi + fi + fi + fi + + # Try to set the core file size (even if we aren't root) because many systems # don't specify a hard limit on core file size. if test -n "$core_file_size" *************** *** 534,540 **** cmd="$NOHUP_NICENESS" for i in "$ledir/$MYSQLD" "$defaults" "--basedir=$MY_BASEDIR_VERSION" \ ! "--datadir=$DATADIR" "$USER_OPTION" do cmd="$cmd "`shell_quote_string "$i"` done --- 562,568 ---- cmd="$NOHUP_NICENESS" for i in "$ledir/$MYSQLD" "$defaults" "--basedir=$MY_BASEDIR_VERSION" \ ! "--datadir=$DATADIR" "$SKIP_THREAD_PRIORITY" "$USER_OPTION" do cmd="$cmd "`shell_quote_string "$i"` done