From 15570d93ce3c744250613f2d4c7689878e7a8d26 Mon Sep 17 00:00:00 2001 From: winlin Date: Thu, 9 Feb 2017 14:17:36 +0800 Subject: [PATCH 1/2] change conf to console without daemon. --- trunk/conf/bandwidth.conf | 2 ++ trunk/conf/dvr.path.conf | 2 ++ trunk/conf/dvr.segment.conf | 2 ++ trunk/conf/dvr.session.conf | 2 ++ trunk/conf/edge.conf | 3 ++- trunk/conf/edge.token.traverse.conf | 2 ++ trunk/conf/ffmpeg.transcode.conf | 2 ++ trunk/conf/forward.master.conf | 4 ++-- trunk/conf/forward.slave.conf | 4 ++-- trunk/conf/hds.conf | 2 -- trunk/conf/hls.conf | 2 ++ trunk/conf/http.aac.live.conf | 2 ++ trunk/conf/http.flv.live.conf | 2 ++ trunk/conf/http.flv.live.edge1.conf | 3 ++- trunk/conf/http.flv.live.edge2.conf | 3 ++- trunk/conf/http.heartbeat.conf | 2 ++ trunk/conf/http.hls.conf | 2 ++ trunk/conf/http.hooks.callback.conf | 4 ++-- trunk/conf/http.mp3.live.conf | 2 ++ trunk/conf/http.server.conf | 2 ++ trunk/conf/http.ts.live.conf | 2 ++ trunk/conf/ingest.conf | 2 ++ trunk/conf/origin.conf | 4 ++-- trunk/conf/push.flv.conf | 2 ++ trunk/conf/push.mpegts.over.udp.conf | 2 ++ trunk/conf/push.rtsp.conf | 2 ++ trunk/conf/realtime.conf | 2 ++ trunk/conf/rtmp.conf | 2 ++ trunk/conf/security.deny.publish.conf | 2 ++ trunk/conf/transcode2hls.audio.only.conf | 2 ++ trunk/conf/transform.edge.conf | 2 ++ 31 files changed, 60 insertions(+), 13 deletions(-) diff --git a/trunk/conf/bandwidth.conf b/trunk/conf/bandwidth.conf index 33ce199b7f..a0bf060048 100644 --- a/trunk/conf/bandwidth.conf +++ b/trunk/conf/bandwidth.conf @@ -3,6 +3,8 @@ listen 1935; max_connections 1000; +daemon off; +srs_log_tank console; vhost __defaultVhost__ { } diff --git a/trunk/conf/dvr.path.conf b/trunk/conf/dvr.path.conf index 8ba6614a18..c5951f0db6 100644 --- a/trunk/conf/dvr.path.conf +++ b/trunk/conf/dvr.path.conf @@ -5,6 +5,8 @@ listen 1935; max_connections 1000; +daemon off; +srs_log_tank console; vhost __defaultVhost__ { dvr { enabled on; diff --git a/trunk/conf/dvr.segment.conf b/trunk/conf/dvr.segment.conf index 1612597a40..2265ad07e9 100644 --- a/trunk/conf/dvr.segment.conf +++ b/trunk/conf/dvr.segment.conf @@ -4,6 +4,8 @@ listen 1935; max_connections 1000; +daemon off; +srs_log_tank console; vhost __defaultVhost__ { dvr { enabled on; diff --git a/trunk/conf/dvr.session.conf b/trunk/conf/dvr.session.conf index a7e0ae0524..8e8d893519 100644 --- a/trunk/conf/dvr.session.conf +++ b/trunk/conf/dvr.session.conf @@ -4,6 +4,8 @@ listen 1935; max_connections 1000; +daemon off; +srs_log_tank console; vhost __defaultVhost__ { dvr { enabled on; diff --git a/trunk/conf/edge.conf b/trunk/conf/edge.conf index f23203005b..2a8662f3c8 100644 --- a/trunk/conf/edge.conf +++ b/trunk/conf/edge.conf @@ -5,7 +5,8 @@ listen 1935; max_connections 1000; pid objs/edge.pid; -srs_log_file ./objs/edge.log; +daemon off; +srs_log_tank console; vhost __defaultVhost__ { mode remote; origin 127.0.0.1:19350; diff --git a/trunk/conf/edge.token.traverse.conf b/trunk/conf/edge.token.traverse.conf index f3e529e668..bad2412f7b 100644 --- a/trunk/conf/edge.token.traverse.conf +++ b/trunk/conf/edge.token.traverse.conf @@ -4,6 +4,8 @@ listen 1935 max_connections 1000; +daemon off; +srs_log_tank console; vhost __defaultVhost__ { mode remote; origin 127.0.0.1:19350; diff --git a/trunk/conf/ffmpeg.transcode.conf b/trunk/conf/ffmpeg.transcode.conf index 1bb505556e..d785a44ffe 100644 --- a/trunk/conf/ffmpeg.transcode.conf +++ b/trunk/conf/ffmpeg.transcode.conf @@ -4,6 +4,8 @@ listen 1935; max_connections 1000; +daemon off; +srs_log_tank console; vhost __defaultVhost__ { transcode { enabled on; diff --git a/trunk/conf/forward.master.conf b/trunk/conf/forward.master.conf index 8283aac17f..af6d502edf 100644 --- a/trunk/conf/forward.master.conf +++ b/trunk/conf/forward.master.conf @@ -5,8 +5,8 @@ listen 1935; max_connections 1000; pid ./objs/srs.master.pid; -srs_log_tank file; -srs_log_file ./objs/srs.master.log; +daemon off; +srs_log_tank console; vhost __defaultVhost__ { forward 127.0.0.1:19350; } diff --git a/trunk/conf/forward.slave.conf b/trunk/conf/forward.slave.conf index 37316c2f59..98286e33e4 100644 --- a/trunk/conf/forward.slave.conf +++ b/trunk/conf/forward.slave.conf @@ -5,7 +5,7 @@ listen 19350; max_connections 1000; pid ./objs/srs.slave.pid; -srs_log_tank file; -srs_log_file ./objs/srs.slave.log; +daemon off; +srs_log_tank console; vhost __defaultVhost__ { } diff --git a/trunk/conf/hds.conf b/trunk/conf/hds.conf index 47811bcb71..c2a7d43ced 100644 --- a/trunk/conf/hds.conf +++ b/trunk/conf/hds.conf @@ -4,10 +4,8 @@ listen 1935; max_connections 1000; - daemon off; srs_log_tank console; -srs_log_level trace; vhost __defaultVhost__ { hds { diff --git a/trunk/conf/hls.conf b/trunk/conf/hls.conf index 8e1a09b655..d0fa42397f 100644 --- a/trunk/conf/hls.conf +++ b/trunk/conf/hls.conf @@ -4,6 +4,8 @@ listen 1935; max_connections 1000; +daemon off; +srs_log_tank console; vhost __defaultVhost__ { hls { enabled on; diff --git a/trunk/conf/http.aac.live.conf b/trunk/conf/http.aac.live.conf index e3fdce78f8..22aa1bda60 100644 --- a/trunk/conf/http.aac.live.conf +++ b/trunk/conf/http.aac.live.conf @@ -4,6 +4,8 @@ listen 1935; max_connections 1000; +daemon off; +srs_log_tank console; http_server { enabled on; listen 8080; diff --git a/trunk/conf/http.flv.live.conf b/trunk/conf/http.flv.live.conf index 9b24ef0d39..944889fb72 100644 --- a/trunk/conf/http.flv.live.conf +++ b/trunk/conf/http.flv.live.conf @@ -4,6 +4,8 @@ listen 1935; max_connections 1000; +daemon off; +srs_log_tank console; http_server { enabled on; listen 8080; diff --git a/trunk/conf/http.flv.live.edge1.conf b/trunk/conf/http.flv.live.edge1.conf index 4cc0de374a..e827c221ee 100644 --- a/trunk/conf/http.flv.live.edge1.conf +++ b/trunk/conf/http.flv.live.edge1.conf @@ -5,7 +5,8 @@ listen 19351; max_connections 1000; pid objs/srs.flv.19351.pid; -srs_log_file objs/srs.flv.19351.log; +daemon off; +srs_log_tank console; http_server { enabled on; listen 8081; diff --git a/trunk/conf/http.flv.live.edge2.conf b/trunk/conf/http.flv.live.edge2.conf index c5ccef9b3a..669c38037c 100644 --- a/trunk/conf/http.flv.live.edge2.conf +++ b/trunk/conf/http.flv.live.edge2.conf @@ -5,7 +5,8 @@ listen 19352; max_connections 1000; pid objs/srs.flv.19352.pid; -srs_log_file objs/srs.flv.19352.log; +daemon off; +srs_log_tank console; http_server { enabled on; listen 8082; diff --git a/trunk/conf/http.heartbeat.conf b/trunk/conf/http.heartbeat.conf index b40287cfe2..d15ff6a56d 100644 --- a/trunk/conf/http.heartbeat.conf +++ b/trunk/conf/http.heartbeat.conf @@ -3,6 +3,8 @@ listen 1935 max_connections 1000; +daemon off; +srs_log_tank console; heartbeat { enabled on; interval 9.3; diff --git a/trunk/conf/http.hls.conf b/trunk/conf/http.hls.conf index 0b098779f4..17416a2940 100644 --- a/trunk/conf/http.hls.conf +++ b/trunk/conf/http.hls.conf @@ -4,6 +4,8 @@ listen 1935; max_connections 1000; +daemon off; +srs_log_tank console; http_server { enabled on; listen 8080; diff --git a/trunk/conf/http.hooks.callback.conf b/trunk/conf/http.hooks.callback.conf index 06d6365696..d5374d9076 100644 --- a/trunk/conf/http.hooks.callback.conf +++ b/trunk/conf/http.hooks.callback.conf @@ -3,8 +3,8 @@ listen 1935; max_connections 1000; -srs_log_tank file; -srs_log_file ./objs/srs.log; +daemon off; +srs_log_tank console; vhost __defaultVhost__ { http_hooks { enabled on; diff --git a/trunk/conf/http.mp3.live.conf b/trunk/conf/http.mp3.live.conf index 4962f8552a..690a4539ea 100644 --- a/trunk/conf/http.mp3.live.conf +++ b/trunk/conf/http.mp3.live.conf @@ -4,6 +4,8 @@ listen 1935; max_connections 1000; +daemon off; +srs_log_tank console; http_server { enabled on; listen 8080; diff --git a/trunk/conf/http.server.conf b/trunk/conf/http.server.conf index 69c94f39c7..0c840894f8 100644 --- a/trunk/conf/http.server.conf +++ b/trunk/conf/http.server.conf @@ -3,6 +3,8 @@ listen 1935; max_connections 1000; +daemon off; +srs_log_tank console; http_server { enabled on; listen 8080; diff --git a/trunk/conf/http.ts.live.conf b/trunk/conf/http.ts.live.conf index dd1b2be8ee..d445672487 100644 --- a/trunk/conf/http.ts.live.conf +++ b/trunk/conf/http.ts.live.conf @@ -4,6 +4,8 @@ listen 1935; max_connections 1000; +daemon off; +srs_log_tank console; http_server { enabled on; listen 8080; diff --git a/trunk/conf/ingest.conf b/trunk/conf/ingest.conf index 7b3d1c2edf..d77a2f954d 100644 --- a/trunk/conf/ingest.conf +++ b/trunk/conf/ingest.conf @@ -4,6 +4,8 @@ listen 1935; max_connections 1000; +daemon off; +srs_log_tank console; vhost __defaultVhost__ { ingest livestream { enabled on; diff --git a/trunk/conf/origin.conf b/trunk/conf/origin.conf index 1216246110..287d4e98ea 100644 --- a/trunk/conf/origin.conf +++ b/trunk/conf/origin.conf @@ -4,7 +4,7 @@ listen 19350; max_connections 1000; -pid objs/origin.pid; -srs_log_file ./objs/origin.log; +daemon off; +srs_log_tank console; vhost __defaultVhost__ { } diff --git a/trunk/conf/push.flv.conf b/trunk/conf/push.flv.conf index 63357df55f..9e871f9133 100644 --- a/trunk/conf/push.flv.conf +++ b/trunk/conf/push.flv.conf @@ -4,6 +4,8 @@ listen 1935; max_connections 1000; +daemon off; +srs_log_tank console; http_server { enabled on; listen 8080; diff --git a/trunk/conf/push.mpegts.over.udp.conf b/trunk/conf/push.mpegts.over.udp.conf index 65e6df358a..82f2f04c82 100644 --- a/trunk/conf/push.mpegts.over.udp.conf +++ b/trunk/conf/push.mpegts.over.udp.conf @@ -5,6 +5,8 @@ listen 1935; max_connections 1000; +daemon off; +srs_log_tank console; stream_caster { enabled on; caster mpegts_over_udp; diff --git a/trunk/conf/push.rtsp.conf b/trunk/conf/push.rtsp.conf index 619f74d906..016a06796c 100644 --- a/trunk/conf/push.rtsp.conf +++ b/trunk/conf/push.rtsp.conf @@ -5,6 +5,8 @@ listen 1935; max_connections 1000; +daemon off; +srs_log_tank console; stream_caster { enabled on; caster rtsp; diff --git a/trunk/conf/realtime.conf b/trunk/conf/realtime.conf index ac039c8e23..249c7501a6 100644 --- a/trunk/conf/realtime.conf +++ b/trunk/conf/realtime.conf @@ -4,6 +4,8 @@ listen 1935; max_connections 1000; +daemon off; +srs_log_tank console; vhost __defaultVhost__ { gop_cache off; queue_length 10; diff --git a/trunk/conf/rtmp.conf b/trunk/conf/rtmp.conf index 94c740c506..e05f154085 100644 --- a/trunk/conf/rtmp.conf +++ b/trunk/conf/rtmp.conf @@ -4,5 +4,7 @@ listen 1935; max_connections 1000; +daemon off; +srs_log_tank console; vhost __defaultVhost__ { } diff --git a/trunk/conf/security.deny.publish.conf b/trunk/conf/security.deny.publish.conf index 0c71bb9b2f..fc2a2e809d 100644 --- a/trunk/conf/security.deny.publish.conf +++ b/trunk/conf/security.deny.publish.conf @@ -4,6 +4,8 @@ listen 1935; max_connections 1000; +daemon off; +srs_log_tank console; vhost __defaultVhost__ { security { enabled on; diff --git a/trunk/conf/transcode2hls.audio.only.conf b/trunk/conf/transcode2hls.audio.only.conf index 21a1e42b8b..f4361bfaa4 100644 --- a/trunk/conf/transcode2hls.audio.only.conf +++ b/trunk/conf/transcode2hls.audio.only.conf @@ -4,6 +4,8 @@ listen 1935; max_connections 1000; +daemon off; +srs_log_tank console; vhost __defaultVhost__ { hls { enabled on; diff --git a/trunk/conf/transform.edge.conf b/trunk/conf/transform.edge.conf index 970af01c26..5b3a04f02f 100644 --- a/trunk/conf/transform.edge.conf +++ b/trunk/conf/transform.edge.conf @@ -4,6 +4,8 @@ listen 1935; max_connections 1000; +daemon off; +srs_log_tank console; vhost __defaultVhost__ { } vhost source.srs.com { From 99bffea328e8ad66a5cc3a7e53b91cd7ea555a5e Mon Sep 17 00:00:00 2001 From: winlin Date: Thu, 9 Feb 2017 14:29:57 +0800 Subject: [PATCH 2/2] fix #503, disable utilities when reload a source. 2.0.233 --- README.md | 2 ++ trunk/src/app/srs_app_source.cpp | 31 ++++++++++++++++++++++++++++++- trunk/src/core/srs_core.hpp | 2 +- 3 files changed, 33 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 265b515957..b4898a74b5 100755 --- a/README.md +++ b/README.md @@ -346,6 +346,7 @@ Remark: ## History +* v2.0, 2017-02-09, fix [#503][bug #503] disable utilities when reload a source. 2.0.233 * v2.0, 2017-01-22, for [#752][bug #752] release the io then free it for kbps. 2.0.232 * v2.0, 2017-01-18, fix [#750][bug #750] use specific error code for dns resolve. 2.0.231 * v2.0, 2017-01-18, [2.0 beta4(2.0.230)][r2.0b4] released. 86334 lines. @@ -1285,6 +1286,7 @@ Winlin [bug #749]: https://github.com/ossrs/srs/issues/749 [bug #750]: https://github.com/ossrs/srs/issues/750 [bug #752]: https://github.com/ossrs/srs/issues/752 +[bug #503]: https://github.com/ossrs/srs/issues/503 [bug #xxxxxxxxxx]: https://github.com/ossrs/srs/issues/xxxxxxxxxx [exo #828]: https://github.com/google/ExoPlayer/pull/828 diff --git a/trunk/src/app/srs_app_source.cpp b/trunk/src/app/srs_app_source.cpp index 1771bbb28c..6657b0adce 100755 --- a/trunk/src/app/srs_app_source.cpp +++ b/trunk/src/app/srs_app_source.cpp @@ -1227,6 +1227,12 @@ int SrsSource::on_reload_vhost_forward(string vhost) // forwarders destroy_forwarders(); + + // Don't start forwarders when source is not active. + if (_can_publish) { + return ret; + } + if ((ret = create_forwarders()) != ERROR_SUCCESS) { srs_error("create forwarders failed. ret=%d", ret); return ret; @@ -1247,6 +1253,12 @@ int SrsSource::on_reload_vhost_hls(string vhost) #ifdef SRS_AUTO_HLS hls->on_unpublish(); + + // Don't start forwarders when source is not active. + if (_can_publish) { + return ret; + } + if ((ret = hls->on_publish(_req, true)) != ERROR_SUCCESS) { srs_error("hls publish failed. ret=%d", ret); return ret; @@ -1267,6 +1279,12 @@ int SrsSource::on_reload_vhost_hds(string vhost) #ifdef SRS_AUTO_HDS hds->on_unpublish(); + + // Don't start forwarders when source is not active. + if (_can_publish) { + return ret; + } + if ((ret = hds->on_publish(_req)) != ERROR_SUCCESS) { srs_error("hds publish failed. ret=%d", ret); return ret; @@ -1288,7 +1306,12 @@ int SrsSource::on_reload_vhost_dvr(string vhost) #ifdef SRS_AUTO_DVR // cleanup dvr dvr->on_unpublish(); - + + // Don't start forwarders when source is not active. + if (_can_publish) { + return ret; + } + // reinitialize the dvr, update plan. if ((ret = dvr->initialize(this, _req)) != ERROR_SUCCESS) { return ret; @@ -1316,6 +1339,12 @@ int SrsSource::on_reload_vhost_transcode(string vhost) #ifdef SRS_AUTO_TRANSCODE encoder->on_unpublish(); + + // Don't start forwarders when source is not active. + if (_can_publish) { + return ret; + } + if ((ret = encoder->on_publish(_req)) != ERROR_SUCCESS) { srs_error("start encoder failed. ret=%d", ret); return ret; diff --git a/trunk/src/core/srs_core.hpp b/trunk/src/core/srs_core.hpp index 77ee2d2578..7b9c6f9070 100644 --- a/trunk/src/core/srs_core.hpp +++ b/trunk/src/core/srs_core.hpp @@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // current release version #define VERSION_MAJOR 2 #define VERSION_MINOR 0 -#define VERSION_REVISION 232 +#define VERSION_REVISION 233 // generated by configure, only macros. #include