diff options
author | Sergei Golubchik <serg@mariadb.org> | 2016-09-29 10:16:24 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2016-09-29 10:16:24 +0200 |
commit | 7497ebf8a49bfe30bb4110f2ac20a30f804b7946 (patch) | |
tree | 06bfc553455754e5198a5b0884502987ae565269 /scripts | |
parent | 0e76054b7b5f09246f31f8927194e9782f82634b (diff) | |
download | mariadb-git-7497ebf8a49bfe30bb4110f2ac20a30f804b7946.tar.gz |
mysqld_safe: close stdout and stderr
when they're not needed anymore. Helps when
daemonizing it from mysql.init
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/mysqld_safe.sh | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 7f18abb3dc2..7cadce725d1 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -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 |