diff options
Diffstat (limited to 'scripts/mysqld_safe.sh')
-rw-r--r-- | scripts/mysqld_safe.sh | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 357dd275d1f..597bf38a518 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -14,7 +14,7 @@ KILL_MYSQLD=1; MYSQLD= niceness=0 -# Default on, unless --log-err is specified (and before options are parsed) +# Default on, unless --log-error is specified (and before options are parsed) syslog=2 user=@MYSQLD_USER@ pid_file= @@ -256,7 +256,7 @@ if [ -n "$err_log" -o $syslog -eq 0 ] then if [ -n "$err_log" ] then - # mysqld adds ".err" if there is no extension on the --log-err + # mysqld adds ".err" if there is no extension on the --log-error # argument; must match that here, or mysqld_safe will write to a # different log file than mysqld @@ -289,6 +289,25 @@ then syslog=0 fi +USER_OPTION="" +if test -w / -o "$USER" = "root" +then + if test "$user" != "root" -o $SET_USER = 1 + then + USER_OPTION="--user=$user" + fi + # Change the err log to the right user, if it is in use + if [ $syslog -eq 0 ]; then + touch $err_log + chown $user $err_log + fi + if test -n "$open_files" + then + ulimit -n $open_files + append_arg_to_args "--open-files-limit=$open_files" + fi +fi + safe_mysql_unix_port=${mysql_unix_port:-${MYSQL_UNIX_PORT:-@MYSQL_UNIX_ADDR@}} # Make sure that directory for $safe_mysql_unix_port exists mysql_unix_port_dir=`dirname $safe_mysql_unix_port` @@ -387,22 +406,6 @@ else fi fi -USER_OPTION="" -if test -w / -o "$USER" = "root" -then - if test "$user" != "root" -o $SET_USER = 1 - then - USER_OPTION="--user=$user" - fi - # If we are root, change the err log to the right user. - touch $err_log; chown $user $err_log - if test -n "$open_files" - then - ulimit -n $open_files - append_arg_to_args "--open-files-limit=$open_files" - 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" |