Subversion Repositories public

Rev

Rev 69 | Rev 73 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 69 Rev 71
Line 296... Line 296...
296
  if (AppArgs::ExistsOption("version")) {
296
  if (AppArgs::ExistsOption("version")) {
297
    fprintf(stderr, "%s\n", INCROND_VERSION);
297
    fprintf(stderr, "%s\n", INCROND_VERSION);
298
    return 0;
298
    return 0;
299
  }
299
  }
300
 
300
 
301
  AppInstance app("incrond");
-
 
302
 
-
 
303
  IncronCfg::Init();
301
  IncronCfg::Init();
304
 
302
 
-
 
303
  std::string cfg;
-
 
304
  if (!AppArgs::GetOption("config", cfg))
-
 
305
    cfg = INCRON_CONFIG;
-
 
306
  IncronCfg::Load(cfg);
-
 
307
 
-
 
308
  std::string lckdir;
-
 
309
  IncronCfg::GetValue("lockfile_dir", lckdir);
-
 
310
  std::string lckfile;
-
 
311
  IncronCfg::GetValue("lockfile_name", lckfile);
-
 
312
  AppInstance app(lckfile, lckdir);
-
 
313
 
305
  if (AppArgs::ExistsOption("kill")) {
314
  if (AppArgs::ExistsOption("kill")) {
306
    fprintf(stderr, "attempting to terminate a running instance of incrond...\n");
315
    fprintf(stderr, "attempting to terminate a running instance of incrond...\n");
307
    if (app.SendSignal(SIGTERM)) {
316
    if (app.SendSignal(SIGTERM)) {
308
      fprintf(stderr, "instance(s) notified, going down\n");
317
      fprintf(stderr, "instance(s) notified, going down\n");
309
      return 0;
318
      return 0;
Line 320... Line 329...
320
 
329
 
321
  openlog(INCROND_NAME, INCRON_LOG_OPTS, INCRON_LOG_FACIL);
330
  openlog(INCROND_NAME, INCRON_LOG_OPTS, INCRON_LOG_FACIL);
322
 
331
 
323
  syslog(LOG_NOTICE, "starting service (version %s, built on %s %s)", INCRON_VERSION, __DATE__, __TIME__);
332
  syslog(LOG_NOTICE, "starting service (version %s, built on %s %s)", INCRON_VERSION, __DATE__, __TIME__);
324
 
333
 
325
  std::string cfg;
-
 
326
  if (!AppArgs::GetOption("config", cfg))
-
 
327
    cfg = INCRON_CONFIG;
-
 
328
  IncronCfg::Load(cfg);
-
 
329
 
-
 
330
  AppArgs::Destroy();
334
  AppArgs::Destroy();
331
 
335
 
332
  int ret = 0;
336
  int ret = 0;
333
 
337
 
334
  std::string sysBase;
338
  std::string sysBase;