Skip to content

Commit

Permalink
mysqld_safe: close stdout and stderr
Browse files Browse the repository at this point in the history
when they're not needed anymore. Helps when
daemonizing it from mysql.init
  • Loading branch information
vuvova committed Sep 29, 2016
1 parent 0e76054 commit 7497ebf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion scripts/mysqld_safe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,10 @@ else
logging=syslog
fi

# close stdout and stderr, everything goes to $logging now
exec 1>&-
exec 2>&-

USER_OPTION=""
if test -w / -o "$USER" = "root"
then
Expand Down Expand Up @@ -650,7 +654,7 @@ if [ ! -d $mysql_unix_port_dir ]
then
if ! `mkdir -p $mysql_unix_port_dir`
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
fi
chown $user $mysql_unix_port_dir
Expand Down
2 changes: 1 addition & 1 deletion support-files/mysql.server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ case "$mode" in
then
# Give extra arguments to mysqld with the my.cnf file. This script
# 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=$?

# Make lock for RedHat / SuSE
Expand Down

0 comments on commit 7497ebf

Please sign in to comment.