From be7b71294d76a2dc3538acab80566596915996a1 Mon Sep 17 00:00:00 2001 From: winlin Date: Wed, 18 Aug 2021 07:50:05 +0800 Subject: [PATCH 1/5] Update issue template --- .github/ISSUE_TEMPLATE | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/ISSUE_TEMPLATE b/.github/ISSUE_TEMPLATE index fa6f266ec..76702aecf 100644 --- a/.github/ISSUE_TEMPLATE +++ b/.github/ISSUE_TEMPLATE @@ -7,6 +7,8 @@ assignees: '' --- +> 注意:不提供以下信息的Issue会被直接删除(Please follow issue template, or we will delete it) + **描述(Description)** > 描述你遇到了什么问题(Please description your issue here) From cee38ab1e65acaf6f62621c476ab8b36f7b42db5 Mon Sep 17 00:00:00 2001 From: winlin Date: Wed, 18 Aug 2021 08:11:50 +0800 Subject: [PATCH 2/5] Update issue template --- .github/ISSUE_TEMPLATE | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/ISSUE_TEMPLATE b/.github/ISSUE_TEMPLATE index 76702aecf..9aff361bf 100644 --- a/.github/ISSUE_TEMPLATE +++ b/.github/ISSUE_TEMPLATE @@ -9,6 +9,8 @@ assignees: '' > 注意:不提供以下信息的Issue会被直接删除(Please follow issue template, or we will delete it) +> 注意:问题和咨询请提交到SRS星球(Please ask question at) http://bbs.ossrs.net + **描述(Description)** > 描述你遇到了什么问题(Please description your issue here) From 0859fb52987884b9c50168aed81830eb66067896 Mon Sep 17 00:00:00 2001 From: winlin Date: Wed, 18 Aug 2021 08:12:37 +0800 Subject: [PATCH 3/5] Update issue template --- .github/ISSUE_TEMPLATE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE b/.github/ISSUE_TEMPLATE index 9aff361bf..96836bbd7 100644 --- a/.github/ISSUE_TEMPLATE +++ b/.github/ISSUE_TEMPLATE @@ -9,7 +9,7 @@ assignees: '' > 注意:不提供以下信息的Issue会被直接删除(Please follow issue template, or we will delete it) -> 注意:问题和咨询请提交到SRS星球(Please ask question at) http://bbs.ossrs.net +> 注意:咨询和讨论请提交到SRS星球(Please ask question at) http://bbs.ossrs.net **描述(Description)** From a00b4d20144d8ee48543cd5eca765e72f8d95bf5 Mon Sep 17 00:00:00 2001 From: rise Date: Wed, 25 Aug 2021 07:16:46 +0800 Subject: [PATCH 4/5] Ingest: Exit if child process redirect io failed (#2540) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 修复子进程无法打开日志输出重定向导致的fork错误 srs进程fork后,未能输出重定向而返回错误,导致fork的子进程未能出。 * remove the var child_err * Fixed IO redirection error detection * Fixed BUG where lost during logs on normal start --- trunk/src/app/srs_app_process.cpp | 45 ++++++++++++++++++++----------- trunk/src/app/srs_app_process.hpp | 3 +++ 2 files changed, 32 insertions(+), 16 deletions(-) diff --git a/trunk/src/app/srs_app_process.cpp b/trunk/src/app/srs_app_process.cpp index 7a85e326b..ac882805f 100644 --- a/trunk/src/app/srs_app_process.cpp +++ b/trunk/src/app/srs_app_process.cpp @@ -153,6 +153,30 @@ srs_error_t srs_redirect_output(string from_file, int to_fd) return err; } +srs_error_t SrsProcess::redirect_io() +{ + srs_error_t err = srs_success; + + // for the stdout, ignore when not specified. + // redirect stdout to file if possible. + if ((err = srs_redirect_output(stdout_file, STDOUT_FILENO)) != srs_success) { + return srs_error_wrap(err, "redirect stdout"); + } + + // for the stderr, ignore when not specified. + // redirect stderr to file if possible. + if ((err = srs_redirect_output(stderr_file, STDERR_FILENO)) != srs_success) { + return srs_error_wrap(err, "redirect stderr"); + } + + // 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 /dev/null"); + } + + return err; +} + srs_error_t SrsProcess::start() { srs_error_t err = srs_success; @@ -182,24 +206,13 @@ srs_error_t SrsProcess::start() // ignore the SIGINT and SIGTERM signal(SIGINT, SIG_IGN); signal(SIGTERM, SIG_IGN); - - // for the stdout, ignore when not specified. - // redirect stdout to file if possible. - if ((err = srs_redirect_output(stdout_file, STDOUT_FILENO)) != srs_success) { - return srs_error_wrap(err, "redirect output"); - } - // for the stderr, ignore when not specified. - // redirect stderr to file if possible. - if ((err = srs_redirect_output(stderr_file, STDERR_FILENO)) != srs_success) { - return srs_error_wrap(err, "redirect output"); + // redirect standard I/O, if it failed, output error to stdout, and exit child process. + if ((err = redirect_io()) != srs_success) { + fprintf(stdout, "child process error, %s\n", srs_error_desc(err).c_str()); + exit(-1); } - - // 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. diff --git a/trunk/src/app/srs_app_process.hpp b/trunk/src/app/srs_app_process.hpp index 4db231ca6..906fa5607 100644 --- a/trunk/src/app/srs_app_process.hpp +++ b/trunk/src/app/srs_app_process.hpp @@ -53,6 +53,9 @@ public: // @param argv the argv for binary path, the argv[0] generally is the binary. // @remark the argv[0] must be the binary. virtual srs_error_t initialize(std::string binary, std::vector argv); +private: + // Redirect standard I/O. + virtual srs_error_t redirect_io(); public: // Start the process, ignore when already started. virtual srs_error_t start(); From ef2442b666c61643722625412bfb90b49288a277 Mon Sep 17 00:00:00 2001 From: winlin Date: Wed, 25 Aug 2021 07:35:27 +0800 Subject: [PATCH 5/5] Update AUTHORS --- README.md | 17 +++++++++-------- trunk/AUTHORS.txt | 45 ++++++++++++++++++++++++--------------------- 2 files changed, 33 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index f8647ca30..a6b30a272 100755 --- a/README.md +++ b/README.md @@ -79,14 +79,15 @@ There are two types of people that have contributed to the SRS project: Maintainers of SRS project: -* [Winlin](https://github.com/winlinvip): All areas of streaming server and documents. -* [Wenjie](https://github.com/wenjiegit): The focus of his work is on the [HDS](https://github.com/simple-rtmp-server/srs/wiki/v4_CN_DeliveryHDS) module. -* [Runner365](https://github.com/runner365): The focus of his work is on the [SRT](https://github.com/simple-rtmp-server/srs/wiki/v4_CN_SRTWiki) module. -* [John](https://github.com/xiaozhihong): Focus on [WebRTC](https://github.com/simple-rtmp-server/srs/wiki/v4_CN_WebRTC) module. -* [B.P.Y(Bepartofyou)](https://github.com/Bepartofyou): Focus on [WebRTC](https://github.com/simple-rtmp-server/srs/wiki/v4_CN_WebRTC) module. -* [Lixin](https://github.com/xialixin): Focus on [GB28181](https://github.com/ossrs/srs/issues/1500) module. -* [Mozhan](https://github.com/lipeng19811218): Focus on [WebRTC](https://github.com/simple-rtmp-server/srs/wiki/v4_CN_WebRTC) module. -* [Jinxue](https://github.com/chen-guanghua): Focus on [WebRTC](https://github.com/simple-rtmp-server/srs/wiki/v4_CN_WebRTC) module. +* [Winlin](https://github.com/winlinvip): Focus on [issues/PR](https://github.com/ossrs/srs/issues) and tests now. +* [Wenjie](https://github.com/wenjiegit): Focus on [HDS](https://github.com/simple-rtmp-server/srs/wiki/v4_CN_DeliveryHDS) module. +* [Runner365](https://github.com/runner365): Focus on [SRT](https://github.com/simple-rtmp-server/srs/wiki/v4_CN_SRTWiki) module. +* [HongdaXiao](https://github.com/xiaozhihong): Focus on [WebRTC](https://github.com/simple-rtmp-server/srs/wiki/v4_CN_WebRTC) module. +* [Bepartofyou](https://github.com/Bepartofyou): Focus on [WebRTC](https://github.com/simple-rtmp-server/srs/wiki/v4_CN_WebRTC) module. +* [XiaLixin](https://github.com/xialixin): Focus on [GB28181](https://github.com/ossrs/srs/issues/1500) module. +* [LiPeng](https://github.com/lipeng19811218): Focus on [WebRTC](https://github.com/simple-rtmp-server/srs/wiki/v4_CN_WebRTC) module. +* [ChenGuanghua](https://github.com/chen-guanghua): Focus on [WebRTC](https://github.com/simple-rtmp-server/srs/wiki/v4_CN_WebRTC) module. +* [HaiboChen](https://github.com/duiniuluantanqin): Focus on [GB28181](https://github.com/ossrs/srs/issues/1500) and [API](https://github.com/ossrs/srs/issues/1657) module. A big THANK YOU goes to: diff --git a/trunk/AUTHORS.txt b/trunk/AUTHORS.txt index a4b17dbd0..4f433e5bc 100644 --- a/trunk/AUTHORS.txt +++ b/trunk/AUTHORS.txt @@ -1,10 +1,10 @@ CONTRIBUTORS ordered by first contribution. -* winlinvip -* winlinvip -* winlinvip -* wenjiegit -* wenjiegit<740936897@qq.com> -* wenjiegit +* Winlin +* Winlin +* Winlin +* Wenjie +* Wenjie<740936897@qq.com> +* Wenjie * xiangcheng.liu * naijia.liu * alcoholyi @@ -53,33 +53,34 @@ CONTRIBUTORS ordered by first contribution. * qiang.li * HungMingWu * Himer -* xialixin -* xialixin<68469352@qq.com> -* xialixin -* xialixin +* XiaLixin +* XiaLixin<68469352@qq.com> +* XiaLixin +* XiaLixin * alphonsetai * Michael.Ma * lam2003 -* runner365 -* runner365 +* Runner365 +* Runner365 * XiaofengWang -* xiaozhihong -* xiaozhihong -* xiaozhihong +* HongdaXiao +* HongdaXiao +* HongdaXiao * yanghuiwen * Bepartofyou<309554135@qq.com> * Bepartofyou * l<22312935+lam2003@users.noreply.github.com> * xfalcon -* chen-guanghua -* chen-guanghua -* lipeng19811218 -* lipeng19811218 +* ChenGuanghua +* ChenGuanghua +* LiPeng +* LiPeng * yajun18 * liulichuan * yapingcat * chenchengbin -* duiniuluantanqin +* HaiboChen<495810242@qq.com> +* HaiboChen * jasongwq * yinjiaoyuan * PieerePi @@ -91,4 +92,6 @@ CONTRIBUTORS ordered by first contribution. * stone * cfw11<34058899+cfw11@users.noreply.github.com> * Hung-YiChen -* long \ No newline at end of file +* long +* matthew1838<77285055+matthew1838@users.noreply.github.com> +* rise \ No newline at end of file