Show
Ignore:
Timestamp:
01/26/08 20:48:28 (6 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1201380508 +0000
git-parent:

[2c65def60e6630d515d47a2135e89e7961c4c5b9]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1201380508 +0000
Message:

glue up some actual XML

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/noitd.c

    r2c65def rcaa7b86  
    88#include <fcntl.h> 
    99 
    10 #include "getopt_long.h" 
    1110#include "eventer/eventer.h" 
    1211#include "utils/noit_log.h" 
     
    3534 
    3635int main(int argc, char **argv) { 
     36  char conf_str[1024]; 
    3737  parse_clargs(argc, argv); 
    3838 
     39  /* First initialize logging, so we can log errors */ 
    3940  noit_log_init(); 
    4041  if(debug) 
     
    4243  noit_log_stream_add_stream(noit_error, noit_stderr); 
    4344 
     45  /* Next load the configs */ 
    4446  noit_conf_init(); 
    4547  if(noit_conf_load(config_file) == -1) { 
    4648    fprintf(stderr, "Cannot load config: '%s'\n", config_file); 
    4749  } 
    48   if(eventer_choose("kqueue") == -1) { 
    49     fprintf(stderr, "Cannot choose kqueue\n"); 
     50 
     51  /* Lastly, run through all other system inits */ 
     52  if(!noit_conf_get_stringbuf(NULL, "/global/eventer/implementation", 
     53                              conf_str, sizeof(conf_str))) { 
     54    noit_log(noit_stderr, NULL, "Cannot find '%s' in configuration\n", 
     55             "/global/eventer/implementation"); 
     56    exit(-1); 
     57  } 
     58  if(eventer_choose(conf_str) == -1) { 
     59    noit_log(noit_stderr, NULL, "Cannot choose eventer %s\n", conf_str); 
    5060    exit(-1); 
    5161  } 
    5262  if(eventer_init() == -1) { 
    53     fprintf(stderr, "Cannot init kqueue\n"); 
     63    noit_log(noit_stderr, NULL, "Cannot init eventer %s\n", conf_str); 
    5464    exit(-1); 
    5565  } 
     66  noit_console_init(); 
    5667 
    57   noit_listener("127.0.0.1", 23123, SOCK_STREAM, 5, noit_console_handler, NULL); 
     68  noit_listener_init(); 
     69 
    5870  eventer_loop(); 
    5971  return 0;