Changeset 1226 for box/chris/merge/bin/bbackupd/BackupDaemon.cpp
- Timestamp:
- 16/12/2006 20:27:44 (5 years ago)
- File:
-
- 1 edited
-
box/chris/merge/bin/bbackupd/BackupDaemon.cpp (modified) (59 diffs)
Legend:
- Unmodified
- Added
- Removed
-
box/chris/merge/bin/bbackupd/BackupDaemon.cpp
r1222 r1226 18 18 #ifdef HAVE_SIGNAL_H 19 19 #include <signal.h> 20 #endif21 #ifdef HAVE_SYSLOG_H22 #include <syslog.h>23 20 #endif 24 21 #ifdef HAVE_SYS_PARAM_H … … 77 74 #include "Archive.h" 78 75 #include "Timer.h" 76 #include "Logging.h" 79 77 80 78 #include "MemLeakFindOn.h" … … 225 223 if(GetConfiguration().KeyExists("CommandSocket")) 226 224 { 227 printf(225 BOX_WARNING( 228 226 "==============================================================================\n" 229 227 "SECURITY WARNING: This platform cannot check the credentials of connections to\n" … … 279 277 catch (BoxException &e) 280 278 { 281 ::syslog(LOG_ERR, "Failed to open command socket: %s",279 BOX_ERROR("Failed to open command socket" << 282 280 e.what()); 283 281 SetTerminateWanted(); 284 282 break; // this is fatal to listening thread 285 283 } 286 catch (...) 287 { 288 ::syslog(LOG_ERR, "Failed to open command socket: " 284 catch(std::exception &e) 285 { 286 BOX_ERROR("Failed to open command socket" << 287 e.what()); 288 SetTerminateWanted(); 289 break; // this is fatal to listening thread 290 } 291 catch(...) 292 { 293 BOX_ERROR("Failed to open command socket: " 289 294 "unknown error"); 290 295 SetTerminateWanted(); 291 296 break; // this is fatal to listening thread 292 297 } 293 }294 catch(std::exception &e)295 {296 ::syslog(LOG_ERR, "Failed to open command socket: "297 "%s", e.what());298 SetTerminateWanted();299 break; // this is fatal to listening thread300 }301 catch(...)302 {303 ::syslog(LOG_ERR, "Failed to open command socket: "304 "unknown error");305 SetTerminateWanted();306 break; // this is fatal to listening thread307 }308 298 309 299 try … … 314 304 // This next section comes from Ben's original function 315 305 // Log 316 ::syslog(LOG_INFO,"Connection from command socket");306 BOX_INFO("Connection from command socket"); 317 307 318 308 // Send a header line summarising the configuration … … 338 328 !IsTerminateWanted()) 339 329 { 340 TRACE1("Received command '%s' over "341 "command socket\n", command.c_str());330 BOX_TRACE("Received command '" << command 331 << "' over command socket"); 342 332 343 333 bool sendOK = false; … … 380 370 else 381 371 { 382 ::syslog(LOG_ERR, "Received unknown command '%s' from client", command.c_str()); 372 BOX_ERROR("Received unknown command " 373 "'" << command << "' " 374 "from client"); 383 375 sendResponse = true; 384 376 sendOK = false; … … 405 397 catch(BoxException &e) 406 398 { 407 ::syslog(LOG_ERR,"Communication error with "408 "control client: %s",e.what());399 BOX_ERROR("Communication error with " 400 "control client: " << e.what()); 409 401 } 410 402 catch(std::exception &e) 411 403 { 412 ::syslog(LOG_ERR,"Internal error in command socket "413 "thread: %s",e.what());404 BOX_ERROR("Internal error in command socket " 405 "thread: " << e.what()); 414 406 } 415 407 catch(...) 416 408 { 417 ::syslog(LOG_ERR,"Communication error with control client");409 BOX_ERROR("Communication error with control client"); 418 410 } 419 411 } … … 474 466 catch(std::exception &e) 475 467 { 476 ::syslog(LOG_WARNING,"Internal error while "468 BOX_WARNING("Internal error while " 477 469 "closing command socket after " 478 "another exception: %s",e.what());470 "another exception: " << e.what()); 479 471 } 480 472 catch(...) 481 473 { 482 ::syslog(LOG_WARNING, 483 "Error closing command socket " 474 BOX_WARNING("Error closing command socket " 484 475 "after exception, ignored."); 485 476 } … … 675 666 !DeleteStoreObjectInfo()) 676 667 { 677 ::syslog(LOG_ERR,"Failed to delete the "668 BOX_ERROR("Failed to delete the " 678 669 "StoreObjectInfoFile, backup cannot " 679 670 "continue safely."); … … 698 689 // Set state and log start 699 690 SetState(State_Connected); 700 ::syslog(LOG_INFO,"Beginning scan of local files");691 BOX_INFO("Beginning scan of local files"); 701 692 702 693 std::string extendedLogFile; … … 811 802 812 803 // Log 813 ::syslog(LOG_INFO,"Finished scan of local files");804 BOX_INFO("Finished scan of local files"); 814 805 815 806 // -------------------------------------------------------------------------------------------- … … 835 826 catch(std::exception &e) 836 827 { 837 ::syslog(LOG_ERR,"Internal error during "838 "backup run: %s",e.what());828 BOX_ERROR("Internal error during " 829 "backup run: " << e.what()); 839 830 errorOccurred = true; 840 831 } … … 865 856 if(StopRun()) 866 857 { 867 ::syslog(LOG_INFO, "Exception (%d/%d) due to signal", errorCode, errorSubCode); 858 BOX_INFO("Exception (" << errorCode 859 << "/" << errorSubCode 860 << ") due to signal"); 868 861 return; 869 862 } … … 872 865 if(isBerkelyDbFailure) 873 866 { 874 ::syslog(LOG_ERR, "Berkely db inode map files corrupted, deleting and restarting scan. Renamed files and directories will not be tracked until after this scan.\n");867 BOX_ERROR("Berkely db inode map files corrupted, deleting and restarting scan. Renamed files and directories will not be tracked until after this scan."); 875 868 ::sleep(1); 876 869 } … … 879 872 // Not restart/terminate, pause and retry 880 873 SetState(State_Error); 881 ::syslog(LOG_ERR,882 "Exception caught (%s %d/%d), "883 "reset state and waiting "884 "to retry...",885 errorString, errorCode,886 errorSubCode);874 BOX_ERROR("Exception caught (" 875 << errorString 876 << " " << errorCode 877 << "/" << errorSubCode 878 << "), reset state and " 879 "waiting to retry..."); 887 880 ::sleep(10); 888 881 nextSyncTime = currentSyncStartTime + … … 895 888 896 889 // Log the stats 897 ::syslog(LOG_INFO, "File statistics: total file size uploaded %lld, bytes already on server %lld, encoded size %lld", 898 BackupStoreFile::msStats.mBytesInEncodedFiles, BackupStoreFile::msStats.mBytesAlreadyOnServer, 899 BackupStoreFile::msStats.mTotalFileStreamSize); 890 BOX_INFO("File statistics: total file size uploaded " 891 << BackupStoreFile::msStats.mBytesInEncodedFiles 892 << ", bytes already on server " 893 << BackupStoreFile::msStats.mBytesAlreadyOnServer 894 << ", encoded size " 895 << BackupStoreFile::msStats.mTotalFileStreamSize); 900 896 BackupStoreFile::ResetStats(); 901 897 … … 967 963 catch(ConversionException &e) 968 964 { 969 ::syslog(LOG_ERR, "Invalid output " 970 "from SyncAllowScript '%s': " 971 "'%s'", 972 conf.GetKeyValue("SyncAllowScript").c_str(), 973 line.c_str()); 965 BOX_ERROR("Invalid output " 966 "from SyncAllowScript '" 967 << conf.GetKeyValue("SyncAllowScript") 968 << "': '" << line << "'"); 974 969 throw; 975 970 } 976 971 977 ::syslog(LOG_INFO, "Delaying sync by %d seconds (SyncAllowScript '%s')", waitInSeconds, conf.GetKeyValue("SyncAllowScript").c_str()); 972 BOX_INFO("Delaying sync by " << waitInSeconds 973 << " seconds (SyncAllowScript '" 974 << conf.GetKeyValue("SyncAllowScript") 975 << "')"); 978 976 } 979 977 } … … 982 980 catch(std::exception &e) 983 981 { 984 ::syslog(LOG_ERR,"Internal error running SyncAllowScript: "985 "%s",e.what());982 BOX_ERROR("Internal error running SyncAllowScript: " 983 << e.what()); 986 984 } 987 985 catch(...) … … 989 987 // Ignore any exceptions 990 988 // Log that something bad happened 991 ::syslog(LOG_ERR, "Error running SyncAllowScript '%s'", conf.GetKeyValue("SyncAllowScript").c_str()); 989 BOX_ERROR("Error running SyncAllowScript '" 990 << conf.GetKeyValue("SyncAllowScript") << "'"); 992 991 } 993 992 … … 1041 1040 if(mpCommandSocketInfo == 0) {::sleep(1); return;} // failure case isn't too bad 1042 1041 1043 TRACE1("Wait on command socket, delay = %lld\n",RequiredDelay);1042 BOX_TRACE("Wait on command socket, delay = " << RequiredDelay); 1044 1043 1045 1044 try … … 1067 1066 #ifdef PLATFORM_CANNOT_FIND_PEER_UID_OF_UNIX_SOCKET 1068 1067 bool uidOK = true; 1069 ::syslog(LOG_WARNING,"On this platform, no security check can be made on the credentials of peers connecting to the command socket. (bbackupctl)");1068 BOX_WARNING("On this platform, no security check can be made on the credentials of peers connecting to the command socket. (bbackupctl)"); 1070 1069 #else 1071 1070 // Security check -- does the process connecting to this socket have … … 1092 1091 { 1093 1092 // Dump the connection 1094 ::syslog(LOG_ERR,"Incoming command connection from peer had different user ID than this process, or security check could not be completed.");1093 BOX_ERROR("Incoming command connection from peer had different user ID than this process, or security check could not be completed."); 1095 1094 mpCommandSocketInfo->mpConnectedSocket.reset(); 1096 1095 return; … … 1099 1098 { 1100 1099 // Log 1101 ::syslog(LOG_INFO,"Connection from command socket");1100 BOX_INFO("Connection from command socket"); 1102 1101 1103 1102 // Send a header line summarising the configuration and current state … … 1137 1136 && mpCommandSocketInfo->mpGetLine->GetLine(command, false /* no preprocessing */, timeout)) 1138 1137 { 1139 TRACE1("Receiving command '%s' over command socket\n", command.c_str()); 1138 BOX_TRACE("Receiving command '" << command 1139 << "' over command socket"); 1140 1140 1141 1141 bool sendOK = false; … … 1194 1194 catch(std::exception &e) 1195 1195 { 1196 ::syslog(LOG_ERR,"Internal error in command socket thread: "1197 "%s",e.what());1196 BOX_ERROR("Internal error in command socket thread: " 1197 << e.what()); 1198 1198 // If an error occurs, and there is a connection active, just close that 1199 1199 // connection and continue. Otherwise, let the error propagate. … … 1239 1239 try 1240 1240 { 1241 TRACE0("Closing command connection\n");1241 BOX_TRACE("Closing command connection"); 1242 1242 1243 1243 if(mpCommandSocketInfo->mpGetLine) … … 1250 1250 catch(std::exception &e) 1251 1251 { 1252 ::syslog(LOG_ERR,"Internal error while closing command "1253 "socket: %s",e.what());1252 BOX_ERROR("Internal error while closing command " 1253 "socket: " << e.what()); 1254 1254 } 1255 1255 catch(...) … … 1300 1300 catch(std::exception &e) 1301 1301 { 1302 ::syslog(LOG_ERR,"Internal error while sending to "1303 "command socket client: %s",e.what());1302 BOX_ERROR("Internal error while sending to " 1303 "command socket client: " << e.what()); 1304 1304 CloseCommandConnection(); 1305 1305 } … … 1404 1404 while((entry = ::getmntent(mountPointsFile)) != 0) 1405 1405 { 1406 TRACE1("Found mount point at %s\n",entry->mnt_dir);1406 BOX_TRACE("Found mount point at " << entry->mnt_dir); 1407 1407 mountPoints.insert(std::string(entry->mnt_dir)); 1408 1408 } … … 1426 1426 try 1427 1427 { 1428 1429 1428 // Read all the entries, and put them in the set 1430 1429 struct mnttab entry; 1431 1430 while(getmntent(mountPointsFile, &entry) == 0) 1432 1431 { 1433 TRACE1("Found mount point at %s\n",entry.mnt_mountp);1432 BOX_TRACE("Found mount point at " << entry.mnt_mountp); 1434 1433 mountPoints.insert(std::string(entry.mnt_mountp)); 1435 1434 } … … 1460 1459 i != rLocationsConf.mSubConfigurations.end(); ++i) 1461 1460 { 1462 TRACE0("new location\n");1461 BOX_TRACE("new location"); 1463 1462 // Create a record for it 1464 1463 Location *ploc = new Location; … … 1498 1497 if(ploc->mPath[0] != '/') 1499 1498 { 1500 ::syslog(LOG_ERR, "Location path '%s' isn't absolute", ploc->mPath.c_str()); 1499 BOX_WARNING("Location path '" 1500 << ploc->mPath 1501 << "' is not absolute"); 1501 1502 } 1502 1503 // Go through the mount points found, and find a suitable one … … 1504 1505 { 1505 1506 std::set<std::string, mntLenCompare>::const_iterator i(mountPoints.begin()); 1506 TRACE1("%d potential mount points\n", mountPoints.size()); 1507 BOX_TRACE(mountPoints.size() 1508 << " potential mount points"); 1507 1509 for(; i != mountPoints.end(); ++i) 1508 1510 { … … 1510 1512 // If it matches, the file belongs in that mount point 1511 1513 // (sorting order ensures this) 1512 TRACE1("checking against mount point %s\n", i->c_str());1514 BOX_TRACE("checking against mount point " << *i); 1513 1515 if(::strncmp(i->c_str(), ploc->mPath.c_str(), i->size()) == 0) 1514 1516 { … … 1518 1520 } 1519 1521 } 1520 TRACE2("mount point chosen for %s is %s\n", ploc->mPath.c_str(), mountName.c_str()); 1522 BOX_TRACE("mount point chosen for " 1523 << ploc->mPath << " is " 1524 << mountName); 1521 1525 } 1522 1526 … … 1572 1576 catch (BoxException &e) 1573 1577 { 1574 ::syslog(LOG_ERR, "Failed to get attributes for path " 1575 "'%s', skipping.", ploc->mPath.c_str()); 1578 BOX_ERROR("Failed to get attributes " 1579 "for path '" << ploc->mPath 1580 << "', skipping."); 1576 1581 continue; 1577 1582 } … … 1599 1604 delete ploc; 1600 1605 ploc = 0; 1601 ::syslog(LOG_ERR, "Failed to setup location '%s' path '%s'", 1602 ploc->mName.c_str(), ploc->mPath.c_str()); 1606 BOX_ERROR("Failed to setup location '" 1607 << ploc->mName << "' path '" 1608 << ploc->mPath << "'"); 1603 1609 throw; 1604 1610 } … … 1608 1614 if(dir.GetNumberOfEntries() > 0) 1609 1615 { 1610 ::syslog(LOG_INFO, "%d redundant locations in root directory found, will delete from store after %d seconds.", 1611 dir.GetNumberOfEntries(), BACKUP_DELETE_UNUSED_ROOT_ENTRIES_AFTER); 1616 BOX_INFO(dir.GetNumberOfEntries() << " redundant locations " 1617 "in root directory found, will delete from store " 1618 "after " << BACKUP_DELETE_UNUSED_ROOT_ENTRIES_AFTER 1619 << " seconds."); 1612 1620 1613 1621 // Store directories in list of things to delete … … 1622 1630 mUnusedRootDirEntries.push_back(std::pair<int64_t,std::string>(en->GetObjectID(), name)); 1623 1631 // Log this 1624 ::syslog(LOG_INFO, "Unused location in root: %s", name.c_str());1632 BOX_INFO("Unused location in root: " << name); 1625 1633 } 1626 1634 ASSERT(mUnusedRootDirEntries.size() > 0); … … 1739 1747 1740 1748 // Delete the file 1741 TRACE1("Deleting %s\n", filename.c_str());1749 BOX_TRACE("Deleting " << filename); 1742 1750 ::unlink(filename.c_str()); 1743 1751 … … 1746 1754 1747 1755 // Delete that too 1748 TRACE1("Deleting %s\n", filename.c_str());1756 BOX_TRACE("Deleting " << filename); 1749 1757 ::unlink(filename.c_str()); 1750 1758 } … … 1826 1834 if(::rename(newmap.c_str(), target.c_str()) != 0) 1827 1835 { 1828 ::syslog(LOG_ERR, "failed to rename ID map: " 1829 "%s to %s: %s", 1830 newmap.c_str(), target.c_str(), 1831 strerror(errno)); 1836 BOX_ERROR("failed to rename ID map: " << newmap 1837 << " to " << target << ": " 1838 << strerror(errno)); 1832 1839 THROW_EXCEPTION(CommonException, OSFileError) 1833 1840 } … … 1932 1939 catch(std::exception &e) 1933 1940 { 1934 ::syslog(LOG_ERR,"Internal error while writing state "1935 "to command socket: %s",e.what());1941 BOX_ERROR("Internal error while writing state " 1942 "to command socket: " << e.what()); 1936 1943 CloseCommandConnection(); 1937 1944 } … … 1951 1958 catch(std::exception &e) 1952 1959 { 1953 ::syslog(LOG_ERR,"Internal error while writing state "1954 "to command socket: %s",e.what());1960 BOX_ERROR("Internal error while writing state " 1961 "to command socket: " << e.what()); 1955 1962 CloseCommandConnection(); 1956 1963 } … … 1997 2004 static const char *sEventNames[] = {"store-full", "read-error", 0}; 1998 2005 1999 TRACE1("BackupDaemon::NotifySysadmin() called, event = %d\n",Event);2006 BOX_TRACE("BackupDaemon::NotifySysadmin() called, event = " << Event); 2000 2007 2001 2008 if(Event < 0 || Event > NotifyEvent__MAX) … … 2015 2022 { 2016 2023 // Log, and then return 2017 ::syslog(LOG_ERR, "Not notifying administrator about event %s -- set NotifyScript to do this in future", sEventNames[Event]); 2024 BOX_ERROR("Not notifying administrator about event " 2025 << sEventNames[Event] << " -- set NotifyScript " 2026 "to do this in future"); 2018 2027 return; 2019 2028 } … … 2023 2032 2024 2033 // Log what we're about to do 2025 ::syslog(LOG_INFO, "About to notify administrator about event %s, running script '%s'", sEventNames[Event], script.c_str()); 2034 BOX_INFO("About to notify administrator about event " 2035 << sEventNames[Event] << ", running script '" 2036 << script << "'"); 2026 2037 2027 2038 // Then do it 2028 2039 if(::system(script.c_str()) != 0) 2029 2040 { 2030 ::syslog(LOG_ERR, "Notify script returned an error code. ('%s')", script.c_str()); 2041 BOX_ERROR("Notify script returned an error code. ('" 2042 << script << "')"); 2031 2043 } 2032 2044 … … 2060 2072 2061 2073 // Entries to delete, and it's the right time to do so... 2062 ::syslog(LOG_INFO,"Deleting unused locations from store root...");2074 BOX_INFO("Deleting unused locations from store root..."); 2063 2075 BackupProtocolClient &connection(rContext.GetConnection()); 2064 2076 for(std::vector<std::pair<int64_t,std::string> >::iterator i(mUnusedRootDirEntries.begin()); i != mUnusedRootDirEntries.end(); ++i) … … 2067 2079 2068 2080 // Log this 2069 ::syslog(LOG_INFO, "Deleted %s (ID %08llx) from store root", i->second.c_str(), i->first); 2081 BOX_INFO("Deleted " << i->second << " (ID " << i->first 2082 << ") from store root"); 2070 2083 } 2071 2084 … … 2407 2420 // 2408 2421 aFile.Close(); 2409 ::syslog(LOG_INFO, "Saved store object info file '%s'",2410 StoreObjectInfoFile.c_str());2422 BOX_INFO("Saved store object info file: " 2423 << StoreObjectInfoFile); 2411 2424 } 2412 2425 catch(std::exception &e) 2413 2426 { 2414 ::syslog(LOG_ERR,"Internal error writing store object "2415 "info file ( %s): %s",2416 StoreObjectInfoFile.c_str(),e.what());2427 BOX_ERROR("Internal error writing store object " 2428 "info file (" << StoreObjectInfoFile << "): " 2429 << e.what()); 2417 2430 } 2418 2431 catch(...) 2419 2432 { 2420 ::syslog(LOG_ERR,"Internal error writing store object "2421 "info file ( %s): unknown error",2422 StoreObjectInfoFile.c_str());2433 BOX_ERROR("Internal error writing store object " 2434 "info file (" << StoreObjectInfoFile << "): " 2435 "unknown error"); 2423 2436 } 2424 2437 … … 2471 2484 if(iMagicValue != STOREOBJECTINFO_MAGIC_ID_VALUE) 2472 2485 { 2473 ::syslog(LOG_WARNING, "Store object info file '%s'"2486 BOX_WARNING("Store object info file " 2474 2487 "is not a valid or compatible serialised " 2475 "archive. Will re-cache from store. ",2476 StoreObjectInfoFile.c_str());2488 "archive. Will re-cache from store. " 2489 "(" << StoreObjectInfoFile << ")"); 2477 2490 return false; 2478 2491 } … … 2486 2499 if(strMagicValue != STOREOBJECTINFO_MAGIC_ID_STRING) 2487 2500 { 2488 ::syslog(LOG_WARNING, "Store object info file '%s'"2501 BOX_WARNING("Store object info file " 2489 2502 "is not a valid or compatible serialised " 2490 "archive. Will re-cache from store. ",2491 StoreObjectInfoFile.c_str());2503 "archive. Will re-cache from store. " 2504 "(" << StoreObjectInfoFile << ")"); 2492 2505 return false; 2493 2506 } … … 2502 2515 if(iVersion != STOREOBJECTINFO_VERSION) 2503 2516 { 2504 ::syslog(LOG_WARNING, "Store object info file '%s' " 2505 "version %d unsupported. " 2506 "Will re-cache from store.", 2507 StoreObjectInfoFile.c_str(), 2508 iVersion); 2517 BOX_WARNING("Store object info file " 2518 "version " << iVersion << " unsupported. " 2519 "Will re-cache from store. " 2520 "(" << StoreObjectInfoFile << ")"); 2509 2521 return false; 2510 2522 } … … 2519 2531 if(lastKnownConfigModTime != GetLoadedConfigModifiedTime()) 2520 2532 { 2521 ::syslog(LOG_WARNING, "Store object info file '%s'"2522 "out of date. Will re-cache from store ",2523 StoreObjectInfoFile.c_str());2533 BOX_WARNING("Store object info file " 2534 "out of date. Will re-cache from store. " 2535 "(" << StoreObjectInfoFile << ")"); 2524 2536 return false; 2525 2537 } … … 2568 2580 // 2569 2581 aFile.Close(); 2570 ::syslog(LOG_INFO, "Loaded store object info file '%s', " 2571 "version [%d]", StoreObjectInfoFile.c_str(), 2572 iVersion); 2573 2582 BOX_INFO("Loaded store object info file version " << iVersion 2583 << "(" << StoreObjectInfoFile << ")"); 2584 2574 2585 return true; 2575 2586 } 2576 2587 catch(std::exception &e) 2577 2588 { 2578 ::syslog(LOG_ERR, "Internal error reading store object " 2579 "info file (%s): %s", 2580 StoreObjectInfoFile.c_str(), e.what()); 2589 BOX_ERROR("Internal error reading store object info file: " 2590 << StoreObjectInfoFile << ": " << e.what()); 2581 2591 } 2582 2592 catch(...) 2583 2593 { 2584 ::syslog(LOG_ERR, "Internal error reading store object " 2585 "info file (%s): unknown error", 2586 StoreObjectInfoFile.c_str()); 2594 BOX_ERROR("Internal error reading store object info file: " 2595 << StoreObjectInfoFile << ": unknown error"); 2587 2596 } 2588 2597 … … 2593 2602 theNextSyncTime = 0; 2594 2603 2595 ::syslog(LOG_WARNING, "Requested store object info file '%s' " 2596 "does not exist, not accessible, or inconsistent. " 2597 "Will re-cache from store.", 2598 StoreObjectInfoFile.c_str()); 2599 2604 BOX_WARNING("Store object info file is missing, not accessible, " 2605 "or inconsistent. Will re-cache from store. " 2606 "(" << StoreObjectInfoFile << ")"); 2607 2600 2608 return false; 2601 2609 } … … 2625 2633 { 2626 2634 // File doesn't exist -- so can't be deleted. But something isn't quite right, so log a message 2627 ::syslog(LOG_ERR, "Expected to be able to delete"2628 " store object info file '%s', but the file did not exist.",2629 storeObjectInfoFile.c_str()); 2635 BOX_WARNING("Store object info file did not exist when it " 2636 "was supposed to. (" << storeObjectInfoFile << ")"); 2637 2630 2638 // Return true to stop things going around in a loop 2631 2639 return true; … … 2635 2643 if(::unlink(storeObjectInfoFile.c_str()) != 0) 2636 2644 { 2637 ::syslog(LOG_ERR, "Failed to delete the old " 2638 "store object info file '%s': %s", 2639 storeObjectInfoFile.c_str(), strerror(errno)); 2645 BOX_ERROR("Failed to delete the old store object info file: " 2646 << storeObjectInfoFile << ": "<< strerror(errno)); 2640 2647 return false; 2641 2648 }
Note: See TracChangeset
for help on using the changeset viewer.
