Merge branch 'development' into LTS_development
# Conflicts: # src/controller/controller.cpp
This commit is contained in:
commit
eb6b98b219
3 changed files with 29 additions and 10 deletions
|
@ -301,16 +301,18 @@ int main(int argc, char ** argv){
|
|||
//start main loop
|
||||
Controller::conf.serveThreadedSocket(Controller::handleAPIConnection);
|
||||
//print shutdown reason
|
||||
std::string shutdown_reason;
|
||||
if (!Controller::conf.is_active){
|
||||
shutdown_reason = "user request (received shutdown signal)";
|
||||
}else{
|
||||
shutdown_reason = "socket problem (API port closed)";
|
||||
}
|
||||
/*LTS-START*/
|
||||
if (Controller::restarting){
|
||||
Controller::Log("CONF", "Controller restarting for update");
|
||||
shutdown_reason = "update (on request)";
|
||||
}
|
||||
/*LTS-END*/
|
||||
if (!Controller::conf.is_active){
|
||||
Controller::Log("CONF", "Controller shutting down because of user request (received shutdown signal)");
|
||||
}else{
|
||||
Controller::Log("CONF", "Controller shutting down because of socket problem (API port closed)");
|
||||
}
|
||||
Controller::Log("CONF", "Controller shutting down because of "+shutdown_reason);
|
||||
Controller::conf.is_active = false;
|
||||
//join all joinable threads
|
||||
statsThread.join();
|
||||
|
|
|
@ -76,10 +76,24 @@ namespace Controller {
|
|||
|
||||
/// Writes the current config to shared memory to be used in other processes
|
||||
void writeConfig(){
|
||||
JSON::Value writeConf;
|
||||
static JSON::Value writeConf;
|
||||
bool changed = false;
|
||||
if (writeConf["config"] != Storage["config"]){
|
||||
writeConf["config"] = Storage["config"];
|
||||
VERYHIGH_MSG("Saving new config because of edit in server config structure");
|
||||
changed = true;
|
||||
}
|
||||
if (writeConf["streams"] != Storage["streams"]){
|
||||
writeConf["streams"] = Storage["streams"];
|
||||
VERYHIGH_MSG("Saving new config because of edit in streams");
|
||||
changed = true;
|
||||
}
|
||||
if (writeConf["capabilities"] != capabilities){
|
||||
writeConf["capabilities"] = capabilities;
|
||||
VERYHIGH_MSG("Saving new config because of edit in capabilities");
|
||||
changed = true;
|
||||
}
|
||||
if (!changed){return;}//cancel further processing if no changes
|
||||
|
||||
static IPC::sharedPage mistConfOut("!mistConfig", DEFAULT_CONF_PAGE_SIZE, true);
|
||||
IPC::semaphore configLock("!mistConfLock", O_CREAT | O_RDWR, ACCESSPERMS, 1);
|
||||
|
|
|
@ -96,6 +96,9 @@ namespace Mist {
|
|||
/// thus causing the process to exit cleanly.
|
||||
void Output::onFail(){
|
||||
isInitialized = false;
|
||||
wantRequest = true;
|
||||
parseData= false;
|
||||
streamName.clear();
|
||||
myConn.close();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue