1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

mysqld_safe: close stdout and stderr

when they're not needed anymore. Helps when
daemonizing it from mysql.init
This commit is contained in:
Sergei Golubchik
2016-09-29 10:16:24 +02:00
parent 0e76054b7b
commit 7497ebf8a4
2 changed files with 6 additions and 2 deletions

View File

@ -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
@ -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