From 5d8fb01b45d3c4da0f8d1e69bd7d0282e93f57e1 Mon Sep 17 00:00:00 2001 From: winlin Date: Tue, 7 May 2019 07:46:20 +0800 Subject: [PATCH] Fix #1352, fix typo of daemon. --- trunk/etc/init.d/srs-api | 2 +- trunk/src/app/srs_app_config.cpp | 4 ++-- trunk/src/app/srs_app_config.hpp | 6 +++--- trunk/src/app/srs_app_server.cpp | 2 +- trunk/src/app/srs_app_utility.hpp | 14 +++++++------- trunk/src/main/srs_main_server.cpp | 8 ++++---- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/trunk/etc/init.d/srs-api b/trunk/etc/init.d/srs-api index 758a79a17..64e5413c7 100755 --- a/trunk/etc/init.d/srs-api +++ b/trunk/etc/init.d/srs-api @@ -54,7 +54,7 @@ start() { ok_msg "Starting SRS-api..." # TODO: FIXME: set limit by, for instance, "ulimit -HSn 10000" # TODO: FIXME: write log to, for instance, the same dir of log. - # TODO: FIXME: support deamon, without nohup. + # TODO: FIXME: support daemon, without nohup. (cd ${ROOT}; nohup ${APP} ${CONFIG} >/dev/null 2>&1 &) # check again after start server diff --git a/trunk/src/app/srs_app_config.cpp b/trunk/src/app/srs_app_config.cpp index b3d90a66c..0210eed1d 100644 --- a/trunk/src/app/srs_app_config.cpp +++ b/trunk/src/app/srs_app_config.cpp @@ -3890,7 +3890,7 @@ srs_error_t SrsConfig::check_normal_config() } // asprocess conflict with daemon - if (get_asprocess() && get_deamon()) { + if (get_asprocess() && get_daemon()) { return srs_error_new(ERROR_SYSTEM_CONFIG_INVALID, "daemon conflicts with asprocess"); } @@ -3990,7 +3990,7 @@ string SrsConfig::argv() return _argv; } -bool SrsConfig::get_deamon() +bool SrsConfig::get_daemon() { SrsConfDirective* conf = root->get("daemon"); if (!conf || conf->arg0().empty()) { diff --git a/trunk/src/app/srs_app_config.hpp b/trunk/src/app/srs_app_config.hpp index 6d52eb18e..9d30cae86 100644 --- a/trunk/src/app/srs_app_config.hpp +++ b/trunk/src/app/srs_app_config.hpp @@ -406,10 +406,10 @@ public: // The root directive, no name and args, contains directives. // All directive parsed can retrieve from root. virtual SrsConfDirective* get_root(); - // Get the deamon config. - // If true, SRS will run in deamon mode, fork and fork to reap the + // Get the daemon config. + // If true, SRS will run in daemon mode, fork and fork to reap the // grand-child process to init process. - virtual bool get_deamon(); + virtual bool get_daemon(); // Get the max connections limit of system. // If exceed the max connection, SRS will disconnect the connection. // @remark, linux will limit the connections of each process, diff --git a/trunk/src/app/srs_app_server.cpp b/trunk/src/app/srs_app_server.cpp index 5f0d00830..4d2241bc9 100644 --- a/trunk/src/app/srs_app_server.cpp +++ b/trunk/src/app/srs_app_server.cpp @@ -902,7 +902,7 @@ srs_error_t SrsServer::do_cycle() // for asprocess. bool asprocess = _srs_config->get_asprocess(); - // the deamon thread, update the time cache + // the daemon thread, update the time cache // TODO: FIXME: use SrsHourGlass. while (true) { if (handler && (err = handler->on_cycle()) != srs_success) { diff --git a/trunk/src/app/srs_app_utility.hpp b/trunk/src/app/srs_app_utility.hpp index 2cf3ee54c..e058e0a93 100644 --- a/trunk/src/app/srs_app_utility.hpp +++ b/trunk/src/app/srs_app_utility.hpp @@ -89,7 +89,7 @@ public: // Get system rusage, use cache to avoid performance problem. extern SrsRusage* srs_get_system_rusage(); -// The deamon st-thread will update it. +// The daemon st-thread will update it. extern void srs_update_system_rusage(); // To stat the process info. @@ -339,7 +339,7 @@ public: extern SrsProcSelfStat* srs_get_self_proc_stat(); // Get system cpu stat, use cache to avoid performance problem. extern SrsProcSystemStat* srs_get_system_proc_stat(); -// The deamon st-thread will update it. +// The daemon st-thread will update it. extern void srs_update_proc_stat(); // Stat disk iops @@ -446,7 +446,7 @@ public: // Get disk stat, use cache to avoid performance problem. extern SrsDiskStat* srs_get_disk_stat(); -// The deamon st-thread will update it. +// The daemon st-thread will update it. extern void srs_update_disk_stat(); // Stat system memory info @@ -487,7 +487,7 @@ public: // Get system meminfo, use cache to avoid performance problem. extern SrsMemInfo* srs_get_meminfo(); -// The deamon st-thread will update it. +// The daemon st-thread will update it. extern void srs_update_meminfo(); // system cpu hardware info. @@ -543,7 +543,7 @@ public: // Get platform info, use cache to avoid performance problem. extern SrsPlatformInfo* srs_get_platform_info(); -// The deamon st-thread will update it. +// The daemon st-thread will update it. extern void srs_update_platform_info(); // The network device summary for each network device, for example, eth0, eth1, ethN @@ -586,7 +586,7 @@ public: // Get network devices info, use cache to avoid performance problem. extern SrsNetworkDevices* srs_get_network_devices(); extern int srs_get_network_devices_count(); -// The deamon st-thread will update it. +// The daemon st-thread will update it. extern void srs_update_network_devices(); // The system connections, and srs rtmp network summary @@ -629,7 +629,7 @@ public: // Get network devices info, use cache to avoid performance problem. extern SrsNetworkRtmpServer* srs_get_network_rtmp_server(); -// The deamon st-thread will update it. +// The daemon st-thread will update it. extern void srs_update_rtmp_server(int nb_conn, SrsKbps* kbps); // Get local or peer ip. diff --git a/trunk/src/main/srs_main_server.cpp b/trunk/src/main/srs_main_server.cpp index 7bbc75998..39d518fa0 100644 --- a/trunk/src/main/srs_main_server.cpp +++ b/trunk/src/main/srs_main_server.cpp @@ -378,15 +378,15 @@ srs_error_t run(SrsServer* svr) return srs_error_wrap(err, "server initialize"); } - // If not deamon, directly run master. - if (!_srs_config->get_deamon()) { + // If not daemon, directly run master. + if (!_srs_config->get_daemon()) { if ((err = run_master(svr)) != srs_success) { return srs_error_wrap(err, "run master"); } return srs_success; } - srs_trace("start deamon mode..."); + srs_trace("start daemon mode..."); int pid = fork(); @@ -415,7 +415,7 @@ srs_error_t run(SrsServer* svr) } // son - srs_trace("son(deamon) process running."); + srs_trace("son(daemon) process running."); if ((err = run_master(svr)) != srs_success) { return srs_error_wrap(err, "daemon run master");