diff options
author | monty@work.mysql.com <> | 2001-09-02 20:13:07 +0200 |
---|---|---|
committer | monty@work.mysql.com <> | 2001-09-02 20:13:07 +0200 |
commit | bf1f7a2837cd96a5aa11ae01232b5a2e0f22085d (patch) | |
tree | 13764f67c4bd995d05603d7061d33b11ddcdb100 /scripts/mysqld_safe.sh | |
parent | 447c18954e904e5770d64ae3b0817a16b9060b74 (diff) | |
parent | 7f8f1bd9797e64c700112bf658cea3fa87e129ad (diff) | |
download | mariadb-git-bf1f7a2837cd96a5aa11ae01232b5a2e0f22085d.tar.gz |
merge
Diffstat (limited to 'scripts/mysqld_safe.sh')
-rw-r--r-- | scripts/mysqld_safe.sh | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index ac33c9ad1f2..c6df7400c75 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -36,7 +36,7 @@ parse_arguments() { --basedir=*) MY_BASEDIR_VERSION=`echo "$arg" | sed -e "s;--basedir=;;"` ;; --datadir=*) DATADIR=`echo "$arg" | sed -e "s;--datadir=;;"` ;; --pid-file=*) pid_file=`echo "$arg" | sed -e "s;--pid-file=;;"` ;; - --user=*) user=`echo "$arg" | sed -e "s;--user=;;"` ;; + --user=*) user=`echo "$arg" | sed -e "s;--[^=]*=;;"` ; SET_USER=1 ;; # these two might have been set in a [mysqld_safe] section of my.cnf # they get passed via environment variables to mysqld_safe @@ -113,6 +113,7 @@ fi # these rely on $DATADIR by default, so we'll set them later on pid_file= err_log= +SET_USER=0 # Get first arguments from the my.cnf file, groups [mysqld] and [mysqld_safe] # and then merge with the command line arguments @@ -172,7 +173,10 @@ fi USER_OPTION="" if test -w / then - USER_OPTION="--user=$user" + 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" |