diff options
Diffstat (limited to 'scripts/mysqld_safe.sh')
-rw-r--r-- | scripts/mysqld_safe.sh | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 987c714d3ff..597bf38a518 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -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" |