|
@@ -1676,7 +1676,9 @@ namespace Task
|
|
|
}
|
|
|
if(failStatus == 1){
|
|
|
//安装成功,执行防火墙设置
|
|
|
- m_fsm->SetNewVersionPathToFirewall();
|
|
|
+ if (!m_fsm->m_stopSetFirewall) {
|
|
|
+ m_fsm->SetNewVersionPathToFirewall();
|
|
|
+ }
|
|
|
DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("======end ExecInstall:succ======");
|
|
|
isInstallSucc =true;
|
|
|
}else{
|
|
@@ -2804,6 +2806,10 @@ ErrorCodeEnum CUpgradeTaskFSM::UpgradeToNewVersion()
|
|
|
return Error_Unexpect;
|
|
|
}else{
|
|
|
fflush(fp);
|
|
|
+ int CommitRet = _commit(_fileno(fp));
|
|
|
+ if (CommitRet != 0) {
|
|
|
+ LogWarn(Severity_Middle, Error_Exception, ERR_TASK_UPDATE_ACTIVE_FAIL, CSimpleStringA::Format("UpgradeToNewVersion fail, commit write active.txt fail, err=%d", (int)GetLastError()).GetData());
|
|
|
+ }
|
|
|
fclose(fp);
|
|
|
if (ExistsFileA(strBackupActiveFile.GetData())) {
|
|
|
RemoveFileA(strBackupActiveFile.GetData());
|
|
@@ -2856,6 +2862,10 @@ ErrorCodeEnum CUpgradeTaskFSM::UpgradeToNewVersion()
|
|
|
return Error_Unexpect;
|
|
|
}else{
|
|
|
fflush(fp);
|
|
|
+ int CommitRet = fsync(fileno(fp));
|
|
|
+ if (CommitRet != 0) {
|
|
|
+ LogWarn(Severity_Middle, Error_Exception, ERR_TASK_UPDATE_ACTIVE_FAIL, CSimpleStringA::Format("UpgradeToNewVersion fail, commit write active.txt fail, err=%d", errno).GetData());
|
|
|
+ }
|
|
|
fclose(fp);
|
|
|
if (ExistsFileA(strBackupActiveFile.GetData())) {
|
|
|
RemoveFileA(strBackupActiveFile.GetData());
|
|
@@ -4021,6 +4031,23 @@ ErrorCodeEnum CUpgradeTaskFSM::loadCenterCfgInfo()
|
|
|
LogWarn(Severity_Middle, rc, ERR_TASK_READ_INI_FAIL, "get CenterSetting.ini StartFlag error");
|
|
|
return rc;
|
|
|
}
|
|
|
+
|
|
|
+ int stopSetFirewallInt = 0;
|
|
|
+ rc = spConfig->ReadConfigValueInt("UpgradeManager", "stopSetFirewall", stopSetFirewallInt);
|
|
|
+ if (rc == Error_Succeed) {
|
|
|
+ if (stopSetFirewallInt == 0) {
|
|
|
+ m_stopSetFirewall = false;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ m_stopSetFirewall = true;
|
|
|
+ }
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("init read CenterSetting.ini stopSetFirewall=%d", stopSetFirewallInt);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ LogWarn(Severity_Middle, rc, ERR_TASK_READ_INI_FAIL, "get CenterSetting.ini stopSetFirewall error");
|
|
|
+ return rc;
|
|
|
+ }
|
|
|
+
|
|
|
int queryNewTaskInterval = 0;
|
|
|
rc = spConfig->ReadConfigValueInt("UpgradeManager", "queryNewTaskInterval", queryNewTaskInterval);
|
|
|
if (rc == Error_Succeed) {
|