Fixes config util for nonsection applications, attempt to fix DDV_Controller process spawning.
This commit is contained in:
parent
66b2e8cbc8
commit
96af25e562
2 changed files with 16 additions and 8 deletions
|
@ -261,7 +261,7 @@ void CheckProtocols(Json::Value & p){
|
||||||
if (connports["HTTP"] != tmp){Util::Procs::Stop("HTTP");}
|
if (connports["HTTP"] != tmp){Util::Procs::Stop("HTTP");}
|
||||||
connports["HTTP"] = tmp;
|
connports["HTTP"] = tmp;
|
||||||
if (!Util::Procs::isActive("HTTP")){
|
if (!Util::Procs::isActive("HTTP")){
|
||||||
Util::Procs::Start("HTTP", std::string("DDV_Conn_HTTP -p ")+tmp);
|
Util::Procs::Start("HTTP", std::string("DDV_Conn_HTTP -n -p ")+tmp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (jit.memberName() == std::string("RTMP")){
|
if (jit.memberName() == std::string("RTMP")){
|
||||||
|
@ -270,7 +270,7 @@ void CheckProtocols(Json::Value & p){
|
||||||
if (connports["RTMP"] != tmp){Util::Procs::Stop("RTMP");}
|
if (connports["RTMP"] != tmp){Util::Procs::Stop("RTMP");}
|
||||||
connports["RTMP"] = tmp;
|
connports["RTMP"] = tmp;
|
||||||
if (!Util::Procs::isActive("RTMP")){
|
if (!Util::Procs::isActive("RTMP")){
|
||||||
Util::Procs::Start("RTMP", std::string("DDV_Conn_RTMP -p ")+tmp);
|
Util::Procs::Start("RTMP", std::string("DDV_Conn_RTMP -n -p ")+tmp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -273,7 +273,8 @@ Util::Config::Config(){
|
||||||
|
|
||||||
/// Parses commandline arguments.
|
/// Parses commandline arguments.
|
||||||
/// Calls exit if an unknown option is encountered, printing a help message.
|
/// Calls exit if an unknown option is encountered, printing a help message.
|
||||||
/// Assumes confsection is set.
|
/// confsection must be either already set or never be set at all when this function is called.
|
||||||
|
/// In other words: do not change confsection after calling this function.
|
||||||
void Util::Config::parseArgs(int argc, char ** argv){
|
void Util::Config::parseArgs(int argc, char ** argv){
|
||||||
int opt = 0;
|
int opt = 0;
|
||||||
static const char *optString = "ndvp:i:u:c:h?";
|
static const char *optString = "ndvp:i:u:c:h?";
|
||||||
|
@ -301,11 +302,18 @@ void Util::Config::parseArgs(int argc, char ** argv){
|
||||||
break;
|
break;
|
||||||
case 'h':
|
case 'h':
|
||||||
case '?':
|
case '?':
|
||||||
printf("Options: -h[elp], -?, -v[ersion], -n[odaemon], -d[aemon], -p[ort] VAL, -i[nterface] VAL, -c[onfigfile] VAL, -u[sername] VAL\n");
|
std::string doingdaemon = "true";
|
||||||
printf("Defaults:\n interface: 0.0.0.0\n port: %i\n daemon mode: true\n configfile: /etc/ddvtech.conf\n username: root\n", listen_port);
|
if (!daemon_mode){doingdaemon = "false";}
|
||||||
printf("Username root means no change to UID, no matter what the UID is.\n");
|
if (confsection == ""){
|
||||||
printf("If the configfile exists, it is always loaded first. Commandline settings then overwrite the config file.\n");
|
printf("Options: -h[elp], -?, -v[ersion], -n[odaemon], -d[aemon], -p[ort] VAL, -i[nterface] VAL, -u[sername] VAL\n");
|
||||||
printf("\nThis process takes it directives from the %s section of the configfile.\n", confsection.c_str());
|
printf("Defaults:\n interface: %s\n port: %i\n daemon mode: %s\n username: %s\n", interface.c_str(), listen_port, doingdaemon.c_str(), username.c_str());
|
||||||
|
}else{
|
||||||
|
printf("Options: -h[elp], -?, -v[ersion], -n[odaemon], -d[aemon], -p[ort] VAL, -i[nterface] VAL, -c[onfigfile] VAL, -u[sername] VAL\n");
|
||||||
|
printf("Defaults:\n interface: %s\n port: %i\n daemon mode: %s\n configfile: %s\n username: %s\n", interface.c_str(), listen_port, doingdaemon.c_str(), configfile.c_str(), username.c_str());
|
||||||
|
printf("Username root means no change to UID, no matter what the UID is.\n");
|
||||||
|
printf("If the configfile exists, it is always loaded first. Commandline settings then overwrite the config file.\n");
|
||||||
|
printf("\nThis process takes it directives from the %s section of the configfile.\n", confsection.c_str());
|
||||||
|
}
|
||||||
printf("This is %s version %s\n", argv[0], TOSTRING(VERSION));
|
printf("This is %s version %s\n", argv[0], TOSTRING(VERSION));
|
||||||
exit(1);
|
exit(1);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Reference in a new issue