Changeset 13797 for trunk


Ignore:
Timestamp:
05/20/12 17:37:35 (13 years ago)
Author:
tbretz
Message:
Start the server as late as possible -- but it must be started before the scripts are executed.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/dimctrl.cc

    r13764 r13797  
    116116public:
    117117    DimCtrl(ostream &out=cout) : MessageDimTX("DIM_CONTROL", out),
    118         fLabel(-3), fStop(false), fVerbosity(0), fDebug(false), fIsServer(false),
     118        fLabel(-3), fStop(-1), fVerbosity(0), fDebug(false), fIsServer(false),
    119119        fSrvState("DIM_CONTROL/STATE", "C",
    120120                  "Provides the state of the state machine as quality of service."
     
    234234        fVerbosity = 40;
    235235
     236        if (conf.Has("verbosity"))
     237            fVerbosity = conf.Get<uint32_t>("verbosity");
     238
     239        if (conf.Get<bool>("quiet"))
     240            fVerbosity = 90;
     241
    236242        fIsServer = conf.Get<bool>("server");
     243        fDebug    = conf.Get<bool>("debug");
     244
    237245        if (fIsServer)
    238246        {
     
    240248            // an EXIT if another instance is already running
    241249            DimServer::start("DIM_CONTROL");
    242             sleep(1);
     250            //sleep(1);
    243251            fSrvState.setQuality(-3);
    244252            fSrvState.Update("[boot]");
    245253        }
    246254
    247         if (conf.Has("verbosity"))
    248             fVerbosity = conf.Get<uint32_t>("verbosity");
    249 
    250         if (conf.Get<bool>("quiet"))
    251             fVerbosity = 90;
    252 
    253         fDebug = conf.Get<bool>("debug");
    254 
    255255        return -1;
    256256    }
    257257
    258     void Stop(int stop=1) { fStop = stop; Readline::SetLabel(0); }
     258    void Stop(int stop=0) { fStop = stop; Readline::SetLabel(0); }
    259259    int Run(bool)
    260260    {
    261         while (!fStop)
     261        while (fStop<0)
    262262        {
    263263            const string s = fScript;
     
    271271            usleep(1000);
    272272        }
    273         return fStop-1; }
     273
     274        return fStop;
     275    }
     276
    274277};
    275278
Note: See TracChangeset for help on using the changeset viewer.