~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/main.cc

  • Committer: Lee Bieber
  • Date: 2011-02-11 02:00:55 UTC
  • mfrom: (2155.1.3 build)
  • Revision ID: kalebral@gmail.com-20110211020055-xck466i0geihtgc8
Merge Stewart - moves mark_transaction_to_rollback to be a method in Session
Merge Vijay -  715789: test-drizzle, test-jp etc dont run check
Merge Stewart - 565053: Fork to background

Show diffs side-by-side

added added

removed removed

Lines of Context:
68
68
 
69
69
#include "drizzled/util/backtrace.h"
70
70
 
 
71
extern "C" int daemonize(int nochdir, int noclose, int wait_sigusr1);
 
72
extern "C" int daemon_is_ready(void);
 
73
 
71
74
using namespace drizzled;
72
75
using namespace std;
73
76
namespace fs=boost::filesystem;
75
78
static pthread_t select_thread;
76
79
static uint32_t thr_kill_signal;
77
80
 
 
81
extern bool opt_daemon;
 
82
 
78
83
 
79
84
/**
80
85
  All global error messages are sent here where the first one is stored
245
250
 
246
251
  /* Function generates error messages before abort */
247
252
  error_handler_hook= my_message_sql;
 
253
 
248
254
  /* init_common_variables must get basic settings such as data_home_dir
249
255
     and plugin_load_list. */
250
 
  if (init_common_variables(argc, argv, modules))
 
256
  if (init_basic_variables(argc, argv))
 
257
    unireg_abort(1);                            // Will do exit
 
258
 
 
259
  if (opt_daemon)
 
260
  {
 
261
    if (signal(SIGHUP, SIG_IGN) == SIG_ERR)
 
262
    {
 
263
      perror("Failed to ignore SIGHUP");
 
264
    }
 
265
    if (daemonize(1, 1, 1) == -1)
 
266
    {
 
267
      fprintf(stderr, "failed to daemon() in order to daemonize\n");
 
268
      exit(EXIT_FAILURE);
 
269
    }
 
270
  }
 
271
 
 
272
  if (init_remaining_variables(modules))
251
273
    unireg_abort(1);                            // Will do exit
252
274
 
253
275
  /*
361
383
    }
362
384
  }
363
385
 
 
386
  if (opt_daemon)
 
387
    daemon_is_ready();
364
388
 
365
389
  /* 
366
390
    Listen for new connections and start new session for each connection