- Timestamp:
- 06/19/12 09:59:14 (12 years ago)
- Location:
- fact/Evidence
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/Evidence/Evidence.cc
r14174 r14189 102 102 ExitRequest = false; 103 103 This = this; 104 LocalMode = false; 104 105 105 106 dis_disable_padding(); … … 128 129 // Catch C++ unhandled exceptions 129 130 set_terminate(Terminate); 131 132 // If name server node not set, use localhost and launch dns 133 if (getenv("DIM_DNS_NODE") == NULL) { 134 printf("Environment variable DIM_DNS_NODE not set, will run in local mode. One moment please...\n"); 135 136 if (setenv("DIM_DNS_NODE", "localhost", 0) == -1) { 137 printf("setenv() failed in EvidenceServer::EvidenceServer (%s)\n", strerror(errno)); 138 } 139 else LocalMode = true; 140 141 // Launch dns in a separate process (currently no further checks to avoid zombie generation) 142 if ((ChildPID = fork()) == 0) { 143 if (execlp("dns", "dns", (char *) NULL) == -1) { 144 printf("execlp() failed in child process forked in EvidenceServer::EvidenceServer() (%s)\n", strerror(errno)); 145 exit(EXIT_FAILURE); 146 } 147 } 148 if (ChildPID == -1) printf("fork() failed in EvidenceServer::EvidenceServer() (%s)\n", strerror(errno)); 149 150 // Wait for dns to become active 151 sleep(3); 152 } 130 153 131 154 // Message service and initial message … … 272 295 // Check if successful 273 296 if (!EvidenceServer::ServiceOK(&Config)) { 274 if (Default.empty() ) {297 if (Default.empty() && !LocalMode) { 275 298 Message(FATAL, "Configuration server unreachable, can't retrieve '%s'", Item.c_str()); 276 299 } … … 306 329 307 330 // Terminate if no configuration information found 308 if (Result.empty() ) Message(FATAL, "Missing configuration data '%s'", Item.c_str());331 if (Result.empty() && !LocalMode) Message(FATAL, "Missing configuration data '%s'", Item.c_str()); 309 332 310 333 return Result; -
fact/Evidence/Evidence.h
r12910 r14189 61 61 static pthread_mutex_t Mutex; 62 62 static EvidenceServer *This; 63 bool LocalMode; 64 pid_t ChildPID; 63 65 64 66 static void SignalHandler(int); // static for signal() -
fact/Evidence/readme.txt
r14187 r14189 67 67 13/6/2012 Removed calling Message() before abort() in signal handler, as Message() might get stuck 68 68 19/6/2012 Giving no indices in OpenHistory() will try to open plot for all members of an array 69 If DIM_DNS_NODE not set, EvidenceServer will run in local mode, launching a dns in a separate process on localhost
Note:
See TracChangeset
for help on using the changeset viewer.