Changeset 2658


Ignore:
Timestamp:
08/03/2010 21:30:10 (2 years ago)
Author:
chris
Message:

Merge part of [2597] from trunk into 0.11rc7. Revert the quotes part of
[2588] as it breaks the unit tests.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • box/RELEASE/0.11rc7/bin/bbackupd/BackupDaemon.cpp

    r2593 r2658  
    10181018        int waitInSeconds = (60*5); 
    10191019 
     1020        std::string script(conf.GetKeyValue("SyncAllowScript") +  
     1021                " \"" + GetConfigFileName() + "\""); 
     1022 
    10201023        // Run it? 
    10211024        pid_t pid = 0; 
    10221025        try 
    10231026        { 
    1024                 std::string script("\"" + conf.GetKeyValue("SyncAllowScript") +  
    1025                         "\" \"" + GetConfigFileName() + "\""); 
    1026  
    1027                 std::auto_ptr<IOStream> pscript(LocalProcessStream( 
    1028                         script.c_str(), pid)); 
     1027                std::auto_ptr<IOStream> pscript(LocalProcessStream(script, 
     1028                        pid)); 
    10291029 
    10301030                // Read in the result 
     
    10491049                                { 
    10501050                                        BOX_ERROR("Invalid output from " 
    1051                                                 "SyncAllowScript " << 
    1052                                                 script << ": '" << line << "'"); 
     1051                                                "SyncAllowScript: '" << 
     1052                                                line << "' (" << script << ")"); 
    10531053                                        throw; 
    10541054                                } 
    10551055 
    10561056                                BOX_NOTICE("Delaying sync by " << waitInSeconds 
    1057                                         << " seconds (SyncAllowScript " 
    1058                                         << conf.GetKeyValue("SyncAllowScript") 
    1059                                         << ")"); 
     1057                                        << " seconds due to SyncAllowScript " 
     1058                                        << "(" << script << ")"); 
    10601059                        } 
    10611060                } 
     
    10651064        { 
    10661065                BOX_ERROR("Internal error running SyncAllowScript: " 
    1067                         << e.what()); 
     1066                        << e.what() << " (" << script << ")"); 
    10681067        } 
    10691068        catch(...) 
     
    10711070                // Ignore any exceptions 
    10721071                // Log that something bad happened 
    1073                 BOX_ERROR("Error running SyncAllowScript '" 
    1074                         << conf.GetKeyValue("SyncAllowScript") << "'"); 
     1072                BOX_ERROR("Unknown error running SyncAllowScript (" << 
     1073                        script << ")"); 
    10751074        } 
    10761075 
     
    21892188                { 
    21902189                        BOX_INFO("Not notifying administrator about event " 
    2191                                 << sEventNames[Event] << " -- set NotifyScript " 
     2190                                << sEventNames[Event] << ", set NotifyScript " 
    21922191                                "to do this in future"); 
    21932192                } 
     
    21962195 
    21972196        // Script to run 
    2198         std::string script("\"" + conf.GetKeyValue("NotifyScript") + "\" " + 
     2197        std::string script(conf.GetKeyValue("NotifyScript") + " " + 
    21992198                sEventNames[Event] + " \"" + GetConfigFileName() + "\""); 
    22002199         
    22012200        // Log what we're about to do 
    22022201        BOX_INFO("About to notify administrator about event " 
    2203                 << sEventNames[Event] << ", running script " << script); 
     2202                << sEventNames[Event] << ", running script '" << script << "'"); 
    22042203         
    22052204        // Then do it 
Note: See TracChangeset for help on using the changeset viewer.