Commit 7497ebf8 authored by Sergei Golubchik's avatar Sergei Golubchik

mysqld_safe: close stdout and stderr

when they're not needed anymore. Helps when
daemonizing it from mysql.init
parent 0e76054b
...@@ -620,6 +620,10 @@ else ...@@ -620,6 +620,10 @@ else
logging=syslog logging=syslog
fi fi
# close stdout and stderr, everything goes to $logging now
exec 1>&-
exec 2>&-
USER_OPTION="" USER_OPTION=""
if test -w / -o "$USER" = "root" if test -w / -o "$USER" = "root"
then then
...@@ -650,7 +654,7 @@ if [ ! -d $mysql_unix_port_dir ] ...@@ -650,7 +654,7 @@ if [ ! -d $mysql_unix_port_dir ]
then then
if ! `mkdir -p $mysql_unix_port_dir` if ! `mkdir -p $mysql_unix_port_dir`
then then
echo "Fatal error Can't create database directory '$mysql_unix_port'" log_error "Fatal error Can't create database directory '$mysql_unix_port'"
exit 1 exit 1
fi fi
chown $user $mysql_unix_port_dir chown $user $mysql_unix_port_dir
......
...@@ -308,7 +308,7 @@ case "$mode" in ...@@ -308,7 +308,7 @@ case "$mode" in
then then
# Give extra arguments to mysqld with the my.cnf file. This script # Give extra arguments to mysqld with the my.cnf file. This script
# may be overwritten at next upgrade. # may be overwritten at next upgrade.
$bindir/mysqld_safe --datadir="$datadir" --pid-file="$mysqld_pid_file_path" $other_args >/dev/null & $bindir/mysqld_safe --datadir="$datadir" --pid-file="$mysqld_pid_file_path" $other_args &
wait_for_ready; return_value=$? wait_for_ready; return_value=$?
# Make lock for RedHat / SuSE # Make lock for RedHat / SuSE
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment