diff --git a/README.md b/README.md index ead8a55d2..f6e8e133e 100755 --- a/README.md +++ b/README.md @@ -146,6 +146,7 @@ For previous versions, please read: ## V3 changes +* v3.0, 2020-02-05, For [#1592][bug #1592], fix terminal echo off by redirect process stdin. 3.0.115 * v3.0, 2020-02-04, For [#1186][bug #1186], refactor security check. 3.0.114 * v3.0, 2020-02-04, Fix [#939][bug #939], response right A/V flag in FLV header. 3.0.113 * v3.0, 2020-02-04, For [#939][bug #939], always enable fast FLV streaming. @@ -1642,6 +1643,7 @@ Winlin [bug #1206]: https://github.com/ossrs/srs/issues/1206 [bug #939]: https://github.com/ossrs/srs/issues/939 [bug #1186]: https://github.com/ossrs/srs/issues/1186 +[bug #1592]: https://github.com/ossrs/srs/issues/1592 [bug #xxxxxxxxxxxxx]: https://github.com/ossrs/srs/issues/xxxxxxxxxxxxx [exo #828]: https://github.com/google/ExoPlayer/pull/828 diff --git a/trunk/conf/full.conf b/trunk/conf/full.conf index 9c7f720cd..afa9b700e 100644 --- a/trunk/conf/full.conf +++ b/trunk/conf/full.conf @@ -27,7 +27,7 @@ ff_log_dir ./objs; # the log level for FFMPEG. # info warning error fatal panic quiet # trace debug verbose -# default: warning +# default: info ff_log_level warning; # the log tank, console or file. # if console, print log to console. diff --git a/trunk/src/app/srs_app_config.cpp b/trunk/src/app/srs_app_config.cpp index ebb877f44..79a5b5caf 100644 --- a/trunk/src/app/srs_app_config.cpp +++ b/trunk/src/app/srs_app_config.cpp @@ -5785,7 +5785,7 @@ string SrsConfig::get_ff_log_dir() string SrsConfig::get_ff_log_level() { - static string DEFAULT = "warning"; + static string DEFAULT = "info"; SrsConfDirective* conf = root->get("ff_log_level"); if (!conf || conf->arg0().empty()) { diff --git a/trunk/src/app/srs_app_process.cpp b/trunk/src/app/srs_app_process.cpp index 2b50b9583..8ccc1b72e 100644 --- a/trunk/src/app/srs_app_process.cpp +++ b/trunk/src/app/srs_app_process.cpp @@ -152,7 +152,7 @@ srs_error_t srs_redirect_output(string from_file, int to_fd) // redirect the fd to file. int fd = -1; - int flags = O_CREAT|O_WRONLY|O_APPEND; + int flags = O_CREAT|O_RDWR|O_APPEND; mode_t mode = S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH; if ((fd = ::open(from_file.c_str(), flags, mode)) < 0) { @@ -197,10 +197,7 @@ srs_error_t SrsProcess::start() // ignore the SIGINT and SIGTERM signal(SIGINT, SIG_IGN); signal(SIGTERM, SIG_IGN); - - // for the stdin, - // should never close it or ffmpeg will error. - + // for the stdout, ignore when not specified. // redirect stdout to file if possible. if ((err = srs_redirect_output(stdout_file, STDOUT_FILENO)) != srs_success) { @@ -212,16 +209,22 @@ srs_error_t SrsProcess::start() if ((err = srs_redirect_output(stderr_file, STDERR_FILENO)) != srs_success) { return srs_error_wrap(err, "redirect output"); } - + + // No stdin for process, @bug https://github.com/ossrs/srs/issues/1592 + if ((err = srs_redirect_output("/dev/null", STDIN_FILENO)) != srs_success) { + return srs_error_wrap(err, "redirect input"); + } + // should never close the fd 3+, for it myabe used. // for fd should close at exec, use fnctl to set it. // log basic info to stderr. if (true) { - fprintf(stderr, "\n"); - fprintf(stderr, "process ppid=%d, cid=%d, pid=%d\n", ppid, cid, getpid()); - fprintf(stderr, "process binary=%s, cli: %s\n", bin.c_str(), cli.c_str()); - fprintf(stderr, "process actual cli: %s\n", actual_cli.c_str()); + fprintf(stdout, "\n"); + fprintf(stdout, "process ppid=%d, cid=%d, pid=%d, in=%d, out=%d, err=%d\n", + ppid, cid, getpid(), STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO); + fprintf(stdout, "process binary=%s, cli: %s\n", bin.c_str(), cli.c_str()); + fprintf(stdout, "process actual cli: %s\n", actual_cli.c_str()); } // memory leak in child process, it's ok. diff --git a/trunk/src/core/srs_core_version3.hpp b/trunk/src/core/srs_core_version3.hpp index fe5e458d1..523b6f501 100644 --- a/trunk/src/core/srs_core_version3.hpp +++ b/trunk/src/core/srs_core_version3.hpp @@ -24,6 +24,6 @@ #ifndef SRS_CORE_VERSION3_HPP #define SRS_CORE_VERSION3_HPP -#define SRS_VERSION3_REVISION 114 +#define SRS_VERSION3_REVISION 115 #endif